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
- SQLInt16.cs
- XmlSecureResolver.cs
- SecureStringHasher.cs
- JoinCqlBlock.cs
- InputProviderSite.cs
- OverflowException.cs
- WebPartEditorOkVerb.cs
- AttachedPropertyBrowsableAttribute.cs
- SQLConvert.cs
- LinkedResourceCollection.cs
- OleAutBinder.cs
- QueryModel.cs
- CodeSnippetStatement.cs
- TreeViewHitTestInfo.cs
- WebControlsSection.cs
- QilBinary.cs
- UnhandledExceptionEventArgs.cs
- UInt64Converter.cs
- util.cs
- SmiMetaDataProperty.cs
- DetailsViewInsertedEventArgs.cs
- AuthenticatingEventArgs.cs
- HtmlTextViewAdapter.cs
- ExternalException.cs
- FileClassifier.cs
- NativeMethods.cs
- SafeCertificateStore.cs
- SqlDataAdapter.cs
- XmlConvert.cs
- HashCoreRequest.cs
- Section.cs
- _Connection.cs
- XmlQueryTypeFactory.cs
- WebCategoryAttribute.cs
- TemplateManager.cs
- DataTableCollection.cs
- ManifestResourceInfo.cs
- DataGridViewCellValidatingEventArgs.cs
- DbConnectionPoolIdentity.cs
- Tokenizer.cs
- ClientProxyGenerator.cs
- Tile.cs
- LinkLabelLinkClickedEvent.cs
- NameScope.cs
- DbgUtil.cs
- PageSetupDialog.cs
- DataGridViewDataErrorEventArgs.cs
- ProcessingInstructionAction.cs
- BackgroundWorker.cs
- SourceFilter.cs
- DbDataAdapter.cs
- CodeMemberMethod.cs
- ObjectSpanRewriter.cs
- PaintEvent.cs
- MD5HashHelper.cs
- SvcMapFile.cs
- NativeObjectSecurity.cs
- ipaddressinformationcollection.cs
- UserControlCodeDomTreeGenerator.cs
- RightsDocument.cs
- OciHandle.cs
- NativeMethods.cs
- WorkflowApplicationCompletedException.cs
- CodeDirectiveCollection.cs
- _HeaderInfo.cs
- UriExt.cs
- ConnectionStringSettings.cs
- AxisAngleRotation3D.cs
- CodeBlockBuilder.cs
- TabletDevice.cs
- XmlObjectSerializerReadContextComplex.cs
- TypeGeneratedEventArgs.cs
- InstanceDataCollection.cs
- SharingService.cs
- EventItfInfo.cs
- ApplicationHost.cs
- Int64Storage.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- AuthStoreRoleProvider.cs
- Marshal.cs
- StatusBar.cs
- TableLayoutSettingsTypeConverter.cs
- PlatformCulture.cs
- ScrollData.cs
- NegotiateStream.cs
- RenamedEventArgs.cs
- TrustLevelCollection.cs
- MarkupCompilePass1.cs
- ObjectListComponentEditor.cs
- DataGridViewCell.cs
- NameSpaceExtractor.cs
- TableLayoutPanel.cs
- ProfileSettingsCollection.cs
- KeyConstraint.cs
- ContainerVisual.cs
- XmlILOptimizerVisitor.cs
- _RequestCacheProtocol.cs
- GuidelineSet.cs
- HealthMonitoringSectionHelper.cs
- ControllableStoryboardAction.cs