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
- ControlPersister.cs
- ZoneButton.cs
- TextRenderer.cs
- XmlEncApr2001.cs
- MouseButtonEventArgs.cs
- HyperLink.cs
- SHA384.cs
- WebResourceAttribute.cs
- Crc32.cs
- WmlFormAdapter.cs
- SendKeys.cs
- ReadOnlyDictionary.cs
- FontFamily.cs
- DynamicUpdateCommand.cs
- ByteStorage.cs
- RowCache.cs
- PublisherIdentityPermission.cs
- CheckBox.cs
- State.cs
- VerificationAttribute.cs
- TreeNode.cs
- NameObjectCollectionBase.cs
- _NegoStream.cs
- DayRenderEvent.cs
- StylusButtonEventArgs.cs
- UrlMapping.cs
- DoubleStorage.cs
- DefaultTextStore.cs
- GenerateTemporaryAssemblyTask.cs
- MenuItemAutomationPeer.cs
- InteropExecutor.cs
- RefreshEventArgs.cs
- WindowsGraphics.cs
- BindingEntityInfo.cs
- WebEventCodes.cs
- HtmlUtf8RawTextWriter.cs
- ClientApiGenerator.cs
- QilPatternVisitor.cs
- AssemblyInfo.cs
- GridViewCancelEditEventArgs.cs
- ContentElement.cs
- TypeForwardedToAttribute.cs
- WsatServiceCertificate.cs
- ClassicBorderDecorator.cs
- XmlValidatingReaderImpl.cs
- TextPointerBase.cs
- ExplicitDiscriminatorMap.cs
- FastEncoder.cs
- XmlSortKey.cs
- NotCondition.cs
- FillRuleValidation.cs
- KeyboardDevice.cs
- SaveFileDialog.cs
- DataGridViewRowPostPaintEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- PropertyIDSet.cs
- DataSourceControl.cs
- CapabilitiesSection.cs
- PageBuildProvider.cs
- SystemIPv6InterfaceProperties.cs
- MessageQueueKey.cs
- _SslState.cs
- DesignBindingPicker.cs
- TreeNodeMouseHoverEvent.cs
- WebPartConnectionsCancelEventArgs.cs
- Normalization.cs
- RichTextBox.cs
- Section.cs
- MsmqReceiveHelper.cs
- PrincipalPermission.cs
- SubtreeProcessor.cs
- XamlVector3DCollectionSerializer.cs
- DesignerCommandAdapter.cs
- Matrix.cs
- WindowsRichEdit.cs
- CodeDomSerializerBase.cs
- QuotaExceededException.cs
- StoragePropertyMapping.cs
- FacetEnabledSchemaElement.cs
- localization.cs
- OdbcErrorCollection.cs
- InputScope.cs
- IPHostEntry.cs
- ConfigurationValidatorBase.cs
- StreamReader.cs
- EncodingInfo.cs
- StsCommunicationException.cs
- CompositeCollection.cs
- URLIdentityPermission.cs
- AutoGeneratedField.cs
- HttpCachePolicy.cs
- IdentifierService.cs
- KnownAssembliesSet.cs
- PolicyImporterElementCollection.cs
- MobileResource.cs
- HighlightVisual.cs
- Atom10FormatterFactory.cs
- KeyMatchBuilder.cs
- DeploymentSection.cs
- WebPartHelpVerb.cs