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
- HttpFileCollection.cs
- CompiledELinqQueryState.cs
- PermissionAttributes.cs
- DecoderExceptionFallback.cs
- LeftCellWrapper.cs
- TextChange.cs
- Profiler.cs
- SHA1CryptoServiceProvider.cs
- IdentityModelDictionary.cs
- SpeechSynthesizer.cs
- TrustLevelCollection.cs
- XmlILModule.cs
- TemplateFactory.cs
- ValueChangedEventManager.cs
- BStrWrapper.cs
- WebServiceEndpoint.cs
- PostBackTrigger.cs
- ConsumerConnectionPointCollection.cs
- recordstatescratchpad.cs
- WsatTransactionHeader.cs
- EndEvent.cs
- TemplateColumn.cs
- ComponentChangingEvent.cs
- LogConverter.cs
- PerfService.cs
- webeventbuffer.cs
- SafeUserTokenHandle.cs
- Panel.cs
- GridViewColumnCollection.cs
- TraceUtility.cs
- RemoteCryptoSignHashRequest.cs
- BuildProvider.cs
- Exception.cs
- ClassHandlersStore.cs
- X509CertificateValidator.cs
- StateManager.cs
- sqlmetadatafactory.cs
- CodeMethodReturnStatement.cs
- UserControlDocumentDesigner.cs
- MasterPage.cs
- DataContractSerializerServiceBehavior.cs
- CultureInfoConverter.cs
- WebPartConnectionsCloseVerb.cs
- X509CertificateRecipientClientCredential.cs
- SiteMapHierarchicalDataSourceView.cs
- ChtmlFormAdapter.cs
- MimeWriter.cs
- CreateUserErrorEventArgs.cs
- AccessDataSourceView.cs
- MetadataItemEmitter.cs
- XmlWriterTraceListener.cs
- SplitterPanel.cs
- CompositeDesignerAccessibleObject.cs
- CommandLineParser.cs
- TypeSystem.cs
- ParenthesizePropertyNameAttribute.cs
- BadImageFormatException.cs
- BaseHashHelper.cs
- Label.cs
- AuthorizationRuleCollection.cs
- StrongNamePublicKeyBlob.cs
- DispatcherEventArgs.cs
- ParseHttpDate.cs
- wgx_render.cs
- LoginUtil.cs
- _ListenerAsyncResult.cs
- AlternateView.cs
- InvariantComparer.cs
- Point4DConverter.cs
- PropertyPath.cs
- HiddenFieldPageStatePersister.cs
- DataTableReaderListener.cs
- ActivityInstanceReference.cs
- BindingElement.cs
- SignHashRequest.cs
- SqlExpressionNullability.cs
- ConfigurationStrings.cs
- MenuItem.cs
- GridViewDesigner.cs
- safex509handles.cs
- OdbcDataAdapter.cs
- ActivationArguments.cs
- BitmapSourceSafeMILHandle.cs
- Int32CAMarshaler.cs
- CodeMethodInvokeExpression.cs
- WorkflowOperationBehavior.cs
- hwndwrapper.cs
- DataGridParentRows.cs
- StickyNoteHelper.cs
- TabRenderer.cs
- RowTypeElement.cs
- _AutoWebProxyScriptEngine.cs
- MemberAccessException.cs
- ScrollItemProviderWrapper.cs
- ImageConverter.cs
- XPathItem.cs
- SystemIPv6InterfaceProperties.cs
- Regex.cs
- DataServiceContext.cs
- JoinElimination.cs