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
- BitmapEffectGeneralTransform.cs
- MethodRental.cs
- XmlAttribute.cs
- WbmpConverter.cs
- IPAddressCollection.cs
- Int16Storage.cs
- X509SubjectKeyIdentifierClause.cs
- Column.cs
- DesignerActionUI.cs
- SpecularMaterial.cs
- EditorPartCollection.cs
- Symbol.cs
- TextRangeProviderWrapper.cs
- SQLSingle.cs
- CompilationSection.cs
- XPathDescendantIterator.cs
- BitmapEffectGeneralTransform.cs
- BaseConfigurationRecord.cs
- Msmq.cs
- SamlAuthenticationClaimResource.cs
- BaseParagraph.cs
- InputReportEventArgs.cs
- ExternalException.cs
- WaitHandle.cs
- QueryAccessibilityHelpEvent.cs
- XmlTypeAttribute.cs
- AtomServiceDocumentSerializer.cs
- unitconverter.cs
- BitmapEncoder.cs
- Calendar.cs
- XmlBinaryReader.cs
- StorageScalarPropertyMapping.cs
- QilLiteral.cs
- ReadWriteSpinLock.cs
- AgileSafeNativeMemoryHandle.cs
- DataGridViewAutoSizeModeEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- GridViewAutomationPeer.cs
- EncoderReplacementFallback.cs
- InvalidOperationException.cs
- NavigateEvent.cs
- Point.cs
- KeyboardNavigation.cs
- Cursors.cs
- XamlTemplateSerializer.cs
- SecureUICommand.cs
- DesignerActionVerbList.cs
- SessionSwitchEventArgs.cs
- CryptoKeySecurity.cs
- ObservableDictionary.cs
- FormsIdentity.cs
- GrammarBuilder.cs
- PathNode.cs
- UdpTransportSettings.cs
- GradientBrush.cs
- BamlLocalizableResourceKey.cs
- FormViewRow.cs
- TextRunCache.cs
- FeatureSupport.cs
- AbsoluteQuery.cs
- SoapCodeExporter.cs
- ResourceSet.cs
- EventLogPermissionEntry.cs
- ExecutedRoutedEventArgs.cs
- DetailsViewUpdatedEventArgs.cs
- FontEmbeddingManager.cs
- HttpApplicationStateBase.cs
- SearchForVirtualItemEventArgs.cs
- DataGridSortCommandEventArgs.cs
- HeaderUtility.cs
- ParseHttpDate.cs
- _SpnDictionary.cs
- MarkupExtensionParser.cs
- ApplicationBuildProvider.cs
- StringFunctions.cs
- InvalidOperationException.cs
- ModelUtilities.cs
- RequestCache.cs
- NumberFormatInfo.cs
- DataControlExtensions.cs
- SetMemberBinder.cs
- ValidationPropertyAttribute.cs
- GridErrorDlg.cs
- BinaryFormatter.cs
- MouseGestureConverter.cs
- Walker.cs
- RegexNode.cs
- FixedTextContainer.cs
- OutputScope.cs
- baseshape.cs
- ParserExtension.cs
- CorrelationService.cs
- StateItem.cs
- Point3DCollection.cs
- SmiEventStream.cs
- OracleCommandBuilder.cs
- EntitySqlQueryCacheKey.cs
- TemplatePagerField.cs
- Lasso.cs
- Int64Animation.cs