Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / BooleanExpr.cs / 1305376 / BooleanExpr.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using System.Diagnostics; using System.Globalization; internal sealed class BooleanExpr : ValueQuery { private Query opnd1; private Query opnd2; private bool isOr; public BooleanExpr(Operator.Op op, Query opnd1, Query opnd2) { Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); Debug.Assert(opnd1 != null && opnd2 != null); if (opnd1.StaticType != XPathResultType.Boolean) { opnd1 = new BooleanFunctions(Function.FunctionType.FuncBoolean, opnd1); } if (opnd2.StaticType != XPathResultType.Boolean) { opnd2 = new BooleanFunctions(Function.FunctionType.FuncBoolean, opnd2); } this.opnd1 = opnd1; this.opnd2 = opnd2; isOr = (op == Operator.Op.OR); } private BooleanExpr(BooleanExpr other) : base(other) { this.opnd1 = Clone(other.opnd1); this.opnd2 = Clone(other.opnd2); this.isOr = other.isOr; } public override void SetXsltContext(XsltContext context){ opnd1.SetXsltContext(context); opnd2.SetXsltContext(context); } public override object Evaluate(XPathNodeIterator nodeIterator) { object n1 = opnd1.Evaluate(nodeIterator); if (((bool) n1) == isOr) { return n1; } return opnd2.Evaluate(nodeIterator); } public override XPathNodeIterator Clone() { return new BooleanExpr(this); } public override XPathResultType StaticType { get { return XPathResultType.Boolean; } } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); w.WriteAttributeString("op", (isOr ? Operator.Op.OR : Operator.Op.AND).ToString()); opnd1.PrintQuery(w); opnd2.PrintQuery(w); w.WriteEndElement(); } } } // 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
- RelationshipFixer.cs
- DataQuery.cs
- DeploymentSectionCache.cs
- GridViewDeleteEventArgs.cs
- InternalUserCancelledException.cs
- ItemsPresenter.cs
- HttpGetProtocolReflector.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ProxyElement.cs
- SharedUtils.cs
- ToolStripHighContrastRenderer.cs
- RsaSecurityKey.cs
- OdbcConnectionPoolProviderInfo.cs
- DiagnosticTrace.cs
- MarkerProperties.cs
- ByteAnimationBase.cs
- RunInstallerAttribute.cs
- PrimitiveType.cs
- Menu.cs
- ServiceDebugElement.cs
- ToolStripItem.cs
- HttpPostedFile.cs
- NavigationWindowAutomationPeer.cs
- Image.cs
- TypeReference.cs
- ToggleButtonAutomationPeer.cs
- ButtonPopupAdapter.cs
- ControlIdConverter.cs
- TraversalRequest.cs
- BindingOperations.cs
- WebColorConverter.cs
- XomlCompiler.cs
- CharEnumerator.cs
- LogSwitch.cs
- IdnMapping.cs
- SafeCryptHandles.cs
- RawStylusSystemGestureInputReport.cs
- BoolLiteral.cs
- RegexFCD.cs
- ParentUndoUnit.cs
- DataDocumentXPathNavigator.cs
- CfgSemanticTag.cs
- ListSortDescription.cs
- ClassGenerator.cs
- RootProfilePropertySettingsCollection.cs
- RotateTransform.cs
- MetadataWorkspace.cs
- TextChange.cs
- DatagridviewDisplayedBandsData.cs
- ObjectConverter.cs
- SoapReflector.cs
- CheckBoxStandardAdapter.cs
- ResourceCategoryAttribute.cs
- DSACryptoServiceProvider.cs
- DescendentsWalkerBase.cs
- Vector.cs
- TraceHandlerErrorFormatter.cs
- MouseGesture.cs
- Table.cs
- XmlAttribute.cs
- COM2IDispatchConverter.cs
- RoleManagerSection.cs
- HwndAppCommandInputProvider.cs
- ACE.cs
- DataGridViewCellFormattingEventArgs.cs
- TextTreeRootNode.cs
- HttpConfigurationSystem.cs
- HiddenFieldPageStatePersister.cs
- XmlAggregates.cs
- _NestedSingleAsyncResult.cs
- WebErrorHandler.cs
- SHA512Managed.cs
- CodeAccessSecurityEngine.cs
- EventWaitHandle.cs
- ListBindingHelper.cs
- GridPattern.cs
- AnchoredBlock.cs
- EntitySet.cs
- ActivityTrace.cs
- SqlCrossApplyToCrossJoin.cs
- RowTypeElement.cs
- DataGridViewCellValidatingEventArgs.cs
- ResXResourceWriter.cs
- ColorContextHelper.cs
- dataprotectionpermission.cs
- ActiveDocumentEvent.cs
- Geometry.cs
- PageAdapter.cs
- DeliveryStrategy.cs
- NativeMethods.cs
- ReversePositionQuery.cs
- ButtonBaseAutomationPeer.cs
- GestureRecognizer.cs
- TypeExtensions.cs
- ResourceAttributes.cs
- XmlSchemaSet.cs
- UnauthorizedWebPart.cs
- InputChannel.cs
- XPathSelfQuery.cs
- SplashScreenNativeMethods.cs