Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / BooleanExpr.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Main.cs
- ByteRangeDownloader.cs
- NeutralResourcesLanguageAttribute.cs
- XmlMembersMapping.cs
- hresults.cs
- MetadataArtifactLoaderCompositeFile.cs
- WithParamAction.cs
- DataGridViewImageColumn.cs
- MouseActionConverter.cs
- MenuAdapter.cs
- SchemaElementLookUpTable.cs
- ToolBarOverflowPanel.cs
- IdentityValidationException.cs
- DLinqDataModelProvider.cs
- RepeatBehaviorConverter.cs
- MobileContainerDesigner.cs
- FormViewInsertEventArgs.cs
- RuntimeHandles.cs
- HtmlAnchor.cs
- UnsupportedPolicyOptionsException.cs
- TypeUsage.cs
- OpenTypeMethods.cs
- pingexception.cs
- XmlMtomWriter.cs
- ListViewInsertionMark.cs
- PipelineDeploymentState.cs
- MouseOverProperty.cs
- TrustLevel.cs
- DataControlField.cs
- X509CertificateInitiatorClientCredential.cs
- ProcessStartInfo.cs
- ProviderSettingsCollection.cs
- Memoizer.cs
- SQLString.cs
- ArgIterator.cs
- Base64Decoder.cs
- ContentAlignmentEditor.cs
- CodeConstructor.cs
- ThreadAttributes.cs
- _RequestCacheProtocol.cs
- ApplicationDirectory.cs
- XmlReflectionMember.cs
- AttachInfo.cs
- DesignerWebPartChrome.cs
- SmtpMail.cs
- ConfigXmlElement.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- Expression.cs
- SspiNegotiationTokenAuthenticator.cs
- XmlChildEnumerator.cs
- DesignTimeHTMLTextWriter.cs
- ConfigurationStrings.cs
- ComPlusServiceHost.cs
- Handle.cs
- TableItemStyle.cs
- InkCanvasAutomationPeer.cs
- AlignmentXValidation.cs
- ContentType.cs
- CharEntityEncoderFallback.cs
- BamlBinaryReader.cs
- DataGridCaption.cs
- DbDeleteCommandTree.cs
- HistoryEventArgs.cs
- WebPartManager.cs
- BaseAsyncResult.cs
- MessageQueuePermissionEntry.cs
- JsonByteArrayDataContract.cs
- DoWorkEventArgs.cs
- RuleElement.cs
- DataControlButton.cs
- PropagatorResult.cs
- TextContainerChangeEventArgs.cs
- TagPrefixAttribute.cs
- TabControl.cs
- LZCodec.cs
- RelationshipConverter.cs
- FileCodeGroup.cs
- ListDependantCardsRequest.cs
- ToolStripPanelSelectionGlyph.cs
- DragCompletedEventArgs.cs
- RSAPKCS1SignatureDeformatter.cs
- NavigationHelper.cs
- PageStatePersister.cs
- HelpInfo.cs
- SqlWebEventProvider.cs
- MessageQueuePermissionEntry.cs
- ModuleBuilder.cs
- EventLogEntry.cs
- XmlSignatureManifest.cs
- KeyBinding.cs
- TypeElement.cs
- ListViewInsertEventArgs.cs
- FakeModelItemImpl.cs
- TypeName.cs
- PageParserFilter.cs
- ControlParameter.cs
- VerticalAlignConverter.cs
- _ListenerRequestStream.cs
- BitConverter.cs
- SqlCacheDependencyDatabase.cs