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
- ModelServiceImpl.cs
- RuleSettingsCollection.cs
- SqlProcedureAttribute.cs
- MultilineStringConverter.cs
- DynamicUpdateCommand.cs
- ObjectViewQueryResultData.cs
- CorePropertiesFilter.cs
- ApplicationServiceHelper.cs
- WindowsTokenRoleProvider.cs
- DetailsViewInsertEventArgs.cs
- SimpleTypeResolver.cs
- PropertyIDSet.cs
- ObjectToken.cs
- UserControl.cs
- PersonalizationProviderHelper.cs
- ListSourceHelper.cs
- FileSecurity.cs
- DesignColumnCollection.cs
- EdmSchemaAttribute.cs
- CodeGenerator.cs
- DatatypeImplementation.cs
- PhysicalAddress.cs
- BitmapScalingModeValidation.cs
- ChildTable.cs
- EntityCodeGenerator.cs
- ExceptionValidationRule.cs
- SynchronizationLockException.cs
- SoapSchemaExporter.cs
- DataObjectEventArgs.cs
- StrokeCollection2.cs
- Number.cs
- WebPartAuthorizationEventArgs.cs
- WinEventQueueItem.cs
- InstallerTypeAttribute.cs
- IImplicitResourceProvider.cs
- PrintDialog.cs
- oledbconnectionstring.cs
- TransformGroup.cs
- Point.cs
- FontStretches.cs
- DefaultParameterValueAttribute.cs
- RightsManagementInformation.cs
- CodeGen.cs
- AsyncStreamReader.cs
- Attributes.cs
- Char.cs
- HttpProcessUtility.cs
- FilteredXmlReader.cs
- Table.cs
- AtomContentProperty.cs
- SchemaSetCompiler.cs
- PackagingUtilities.cs
- ProfileManager.cs
- _BasicClient.cs
- DatagridviewDisplayedBandsData.cs
- CheckoutException.cs
- regiisutil.cs
- KeyNotFoundException.cs
- XmlStreamStore.cs
- ChannelManager.cs
- _DomainName.cs
- URLMembershipCondition.cs
- SessionStateModule.cs
- HiddenField.cs
- XmlSchemaIdentityConstraint.cs
- IconConverter.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- BamlLocalizer.cs
- MulticastNotSupportedException.cs
- PageResolution.cs
- XmlRootAttribute.cs
- ProgressBarAutomationPeer.cs
- AsmxEndpointPickerExtension.cs
- ResourcePool.cs
- ADConnectionHelper.cs
- dsa.cs
- FormViewInsertedEventArgs.cs
- XmlComplianceUtil.cs
- EntityContainerEmitter.cs
- SparseMemoryStream.cs
- Overlapped.cs
- StaticResourceExtension.cs
- DesignerDataSourceView.cs
- SkinBuilder.cs
- nulltextnavigator.cs
- SurrogateChar.cs
- ButtonRenderer.cs
- InternalMappingException.cs
- PointCollection.cs
- TranslateTransform3D.cs
- SchemaTypeEmitter.cs
- PostBackOptions.cs
- XPathDocumentIterator.cs
- XmlQueryRuntime.cs
- ADMembershipProvider.cs
- HighContrastHelper.cs
- MaskDescriptor.cs
- DrawingContextDrawingContextWalker.cs
- ApplicationInfo.cs
- MenuEventArgs.cs