Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / Operator.cs / 1305376 / Operator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; using System.Globalization; internal class Operator : AstNode { public enum Op { // order is alligned with XPathOperator INVALID, /*Logical */ OR, AND, /*Equality */ EQ, NE, /*Relational*/ LT, LE, GT, GE, /*Arithmetic*/ PLUS, MINUS, MUL, DIV, MOD, /*Union */ UNION, }; static Op[] invertOp = { /*INVALID*/ Op.INVALID, /*OR */ Op.INVALID, /*END */ Op.INVALID, /*EQ */ Op.EQ, /*NE */ Op.NE, /*LT */ Op.GT, /*LE */ Op.GE, /*GT */ Op.LT, /*GE */ Op.LE, }; static public Operator.Op InvertOperator(Operator.Op op) { Debug.Assert(Op.EQ <= op && op <= Op.GE); return invertOp[(int)op]; } private Op opType; private AstNode opnd1; private AstNode opnd2; public Operator(Op op, AstNode opnd1, AstNode opnd2) { this.opType = op; this.opnd1 = opnd1; this.opnd2 = opnd2; } public override AstType Type { get {return AstType.Operator;} } public override XPathResultType ReturnType { get { if (opType <= Op.GE) { return XPathResultType.Boolean; } if (opType <= Op.MOD) { return XPathResultType.Number; } return XPathResultType.NodeSet; } } public Op OperatorType { get { return opType; } } public AstNode Operand1 { get { return opnd1; } } public AstNode Operand2 { get { return opnd2; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; using System.Globalization; internal class Operator : AstNode { public enum Op { // order is alligned with XPathOperator INVALID, /*Logical */ OR, AND, /*Equality */ EQ, NE, /*Relational*/ LT, LE, GT, GE, /*Arithmetic*/ PLUS, MINUS, MUL, DIV, MOD, /*Union */ UNION, }; static Op[] invertOp = { /*INVALID*/ Op.INVALID, /*OR */ Op.INVALID, /*END */ Op.INVALID, /*EQ */ Op.EQ, /*NE */ Op.NE, /*LT */ Op.GT, /*LE */ Op.GE, /*GT */ Op.LT, /*GE */ Op.LE, }; static public Operator.Op InvertOperator(Operator.Op op) { Debug.Assert(Op.EQ <= op && op <= Op.GE); return invertOp[(int)op]; } private Op opType; private AstNode opnd1; private AstNode opnd2; public Operator(Op op, AstNode opnd1, AstNode opnd2) { this.opType = op; this.opnd1 = opnd1; this.opnd2 = opnd2; } public override AstType Type { get {return AstType.Operator;} } public override XPathResultType ReturnType { get { if (opType <= Op.GE) { return XPathResultType.Boolean; } if (opType <= Op.MOD) { return XPathResultType.Number; } return XPathResultType.NodeSet; } } public Op OperatorType { get { return opType; } } public AstNode Operand1 { get { return opnd1; } } public AstNode Operand2 { get { return opnd2; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HelloOperationCD1AsyncResult.cs
- HttpListenerRequestTraceRecord.cs
- PeerApplication.cs
- NextPreviousPagerField.cs
- HtmlInputImage.cs
- PreloadedPackages.cs
- TrackBarRenderer.cs
- SharedPerformanceCounter.cs
- OdbcCommand.cs
- NamedPipeActivation.cs
- SeparatorAutomationPeer.cs
- TimeSpan.cs
- HasActivatableWorkflowEvent.cs
- DoubleStorage.cs
- XmlNamespaceManager.cs
- ReferenceConverter.cs
- SplitterPanel.cs
- SEHException.cs
- ModelUIElement3D.cs
- FreezableOperations.cs
- MainMenu.cs
- AdornerLayer.cs
- UndoEngine.cs
- FtpWebRequest.cs
- SmtpNtlmAuthenticationModule.cs
- Window.cs
- Intellisense.cs
- Ray3DHitTestResult.cs
- PropertyValue.cs
- SqlCacheDependencyDatabaseCollection.cs
- BindingValueChangedEventArgs.cs
- Int16Storage.cs
- PixelFormats.cs
- DragEventArgs.cs
- VerticalAlignConverter.cs
- MsmqIntegrationOutputChannel.cs
- MediaContext.cs
- SqlRemoveConstantOrderBy.cs
- PreservationFileWriter.cs
- XamlHostingSection.cs
- SerialErrors.cs
- LinqDataSourceInsertEventArgs.cs
- X509Certificate.cs
- ExceptionAggregator.cs
- XmlTextReader.cs
- CodeTryCatchFinallyStatement.cs
- DialogWindow.cs
- StylesEditorDialog.cs
- SqlClientWrapperSmiStreamChars.cs
- FrameworkPropertyMetadata.cs
- Line.cs
- ScaleTransform3D.cs
- InstanceOwner.cs
- RawTextInputReport.cs
- UnsafeNativeMethods.cs
- DispatchOperation.cs
- ClientTargetCollection.cs
- DBConnection.cs
- GetPageNumberCompletedEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- TextCollapsingProperties.cs
- PointConverter.cs
- GrowingArray.cs
- StatusBarItemAutomationPeer.cs
- DocumentReferenceCollection.cs
- TypeConvertions.cs
- MetricEntry.cs
- XmlSerializer.cs
- RecordManager.cs
- SmiEventStream.cs
- ListArgumentProvider.cs
- LockRecoveryTask.cs
- PropertyGridDesigner.cs
- X509Certificate2.cs
- XmlDomTextWriter.cs
- EventProvider.cs
- RequestValidator.cs
- AspNetHostingPermission.cs
- DataGridViewLayoutData.cs
- WinFormsComponentEditor.cs
- TableRowCollection.cs
- SerializationFieldInfo.cs
- OleDbPermission.cs
- DocumentViewerConstants.cs
- FixedDSBuilder.cs
- PeerInvitationResponse.cs
- XslException.cs
- ComponentConverter.cs
- HashHelpers.cs
- TextBoxRenderer.cs
- MostlySingletonList.cs
- ListSortDescription.cs
- Token.cs
- SqlXmlStorage.cs
- SqlCacheDependency.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- XmlTextReaderImplHelpers.cs
- DataGridViewCellStyleConverter.cs
- AuthenticationModuleElement.cs
- NameSpaceExtractor.cs