Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //----------------------------------------------------------------------------- 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
- SelfIssuedAuthRSACryptoProvider.cs
- CultureTableRecord.cs
- ADMembershipProvider.cs
- embossbitmapeffect.cs
- HttpRequestWrapper.cs
- UrlAuthorizationModule.cs
- XmlBinaryReaderSession.cs
- ADRole.cs
- WebSysDefaultValueAttribute.cs
- EditorPartChrome.cs
- RowUpdatingEventArgs.cs
- MDIClient.cs
- ToolStripDropDownMenu.cs
- GlyphsSerializer.cs
- Version.cs
- QuaternionValueSerializer.cs
- GraphicsContainer.cs
- ColorAnimationUsingKeyFrames.cs
- FullTrustAssembliesSection.cs
- OperationDescription.cs
- ProcessStartInfo.cs
- CommentAction.cs
- LiteralControl.cs
- PolicyStatement.cs
- ExternalException.cs
- CannotUnloadAppDomainException.cs
- Signature.cs
- ComponentManagerBroker.cs
- FontFamily.cs
- SoapAttributes.cs
- _TLSstream.cs
- SharedUtils.cs
- VectorConverter.cs
- ClientTargetCollection.cs
- DesignTimeTemplateParser.cs
- LogStream.cs
- FastEncoderWindow.cs
- InputMethodStateChangeEventArgs.cs
- StylusPointPropertyId.cs
- DeferredTextReference.cs
- Label.cs
- GenerateScriptTypeAttribute.cs
- VisualBrush.cs
- SqlDuplicator.cs
- ListViewSortEventArgs.cs
- OdbcHandle.cs
- NavigationHelper.cs
- IncrementalReadDecoders.cs
- CodeMemberEvent.cs
- RunWorkerCompletedEventArgs.cs
- HttpListener.cs
- SerializationEventsCache.cs
- CompositeFontParser.cs
- FontStyleConverter.cs
- FormatSettings.cs
- CustomLineCap.cs
- PrintingPermissionAttribute.cs
- CasesDictionary.cs
- ArraySegment.cs
- SemanticResolver.cs
- ByteStorage.cs
- HttpDictionary.cs
- UnauthorizedWebPart.cs
- ButtonBase.cs
- RtfToXamlReader.cs
- CheckedPointers.cs
- TableLayoutRowStyleCollection.cs
- SecureEnvironment.cs
- DispatcherFrame.cs
- RegexCaptureCollection.cs
- ErrorWrapper.cs
- InputLanguageProfileNotifySink.cs
- CategoriesDocument.cs
- OLEDB_Util.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TreeViewImageIndexConverter.cs
- Queue.cs
- StateRuntime.cs
- PrimarySelectionGlyph.cs
- CodeTypeReferenceExpression.cs
- ConnectionInterfaceCollection.cs
- TrailingSpaceComparer.cs
- LinearGradientBrush.cs
- BooleanAnimationBase.cs
- MonikerBuilder.cs
- DataGridViewRowHeaderCell.cs
- CompletedAsyncResult.cs
- MenuItemStyleCollection.cs
- PageThemeBuildProvider.cs
- DispatcherProcessingDisabled.cs
- Bold.cs
- Size3D.cs
- ClipboardData.cs
- ArrayMergeHelper.cs
- MeasurementDCInfo.cs
- SerializationException.cs
- SqlBulkCopyColumnMapping.cs
- Form.cs
- RewritingSimplifier.cs
- X509ChainPolicy.cs