Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- MailMessageEventArgs.cs
- SqlBulkCopyColumnMappingCollection.cs
- TextSchema.cs
- ObjectReaderCompiler.cs
- ProbeRequestResponseAsyncResult.cs
- WindowsBrush.cs
- JsonWriter.cs
- ReferencedAssemblyResolver.cs
- SecurityDescriptor.cs
- ExternalException.cs
- COM2FontConverter.cs
- RijndaelCryptoServiceProvider.cs
- SystemUdpStatistics.cs
- EditorAttributeInfo.cs
- HtmlUtf8RawTextWriter.cs
- SerializationHelper.cs
- VSWCFServiceContractGenerator.cs
- OutputCacheModule.cs
- TcpDuplicateContext.cs
- AsyncOperation.cs
- NumberFormatInfo.cs
- DataControlImageButton.cs
- DialogResultConverter.cs
- CallbackHandler.cs
- DataListItemEventArgs.cs
- AstTree.cs
- ContentElement.cs
- ExceptionDetail.cs
- CodeMemberField.cs
- HwndProxyElementProvider.cs
- MorphHelper.cs
- SafeRightsManagementEnvironmentHandle.cs
- HttpServerUtilityBase.cs
- TemplateKeyConverter.cs
- RIPEMD160.cs
- ObjectManager.cs
- CompositeDataBoundControl.cs
- RawTextInputReport.cs
- OverlappedAsyncResult.cs
- HelpInfo.cs
- XmlElementList.cs
- ToolStripDropDownMenu.cs
- listitem.cs
- Mapping.cs
- CultureInfoConverter.cs
- Grammar.cs
- InvokeProviderWrapper.cs
- GeneralTransformGroup.cs
- NamespaceMapping.cs
- Helpers.cs
- QuotedStringWriteStateInfo.cs
- EdmFunction.cs
- MimeParameter.cs
- StringReader.cs
- RightsManagementEncryptedStream.cs
- Workspace.cs
- ImportedNamespaceContextItem.cs
- Page.cs
- DispatcherObject.cs
- fixedPageContentExtractor.cs
- StringConverter.cs
- ModulesEntry.cs
- CursorInteropHelper.cs
- DisableDpiAwarenessAttribute.cs
- xmlfixedPageInfo.cs
- CodeCastExpression.cs
- FrameworkReadOnlyPropertyMetadata.cs
- StrongNameKeyPair.cs
- _TimerThread.cs
- DynamicValueConverter.cs
- SafeNativeMethodsOther.cs
- DecoderBestFitFallback.cs
- DesignerLabelAdapter.cs
- SafeCryptContextHandle.cs
- ContentWrapperAttribute.cs
- CodeMemberEvent.cs
- DataGridViewRowHeaderCell.cs
- ZipIOExtraField.cs
- ConcurrentBag.cs
- ConfigXmlSignificantWhitespace.cs
- EventSchemaTraceListener.cs
- CompositeDataBoundControl.cs
- FilterQueryOptionExpression.cs
- ByteAnimationUsingKeyFrames.cs
- ImageClickEventArgs.cs
- Parameter.cs
- ServiceRouteHandler.cs
- DSACryptoServiceProvider.cs
- StreamGeometry.cs
- StackBuilderSink.cs
- SynchronizedChannelCollection.cs
- XDRSchema.cs
- CodeBinaryOperatorExpression.cs
- serverconfig.cs
- XmlReader.cs
- VisualStates.cs
- EnumCodeDomSerializer.cs
- DBDataPermission.cs
- XmlSerializationWriter.cs
- SessionIDManager.cs