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
- Floater.cs
- XamlContextStack.cs
- HiddenField.cs
- Pipe.cs
- SystemGatewayIPAddressInformation.cs
- Selector.cs
- LabelTarget.cs
- EditingCommands.cs
- BindingManagerDataErrorEventArgs.cs
- CommonXSendMessage.cs
- DescendantQuery.cs
- FieldInfo.cs
- InstanceStoreQueryResult.cs
- SpeechUI.cs
- ChannelTerminatedException.cs
- ListView.cs
- Pair.cs
- MultipleViewPatternIdentifiers.cs
- SoapServerMethod.cs
- ResourcePermissionBaseEntry.cs
- mil_commands.cs
- KeyValuePairs.cs
- TimeSpanMinutesConverter.cs
- LabelAutomationPeer.cs
- OracleTimeSpan.cs
- LoginCancelEventArgs.cs
- SystemFonts.cs
- SignedPkcs7.cs
- COM2FontConverter.cs
- SafeHandles.cs
- Crc32.cs
- RightNameExpirationInfoPair.cs
- HttpChannelBindingToken.cs
- GridViewColumnCollection.cs
- StringWriter.cs
- CqlQuery.cs
- DesignerContextDescriptor.cs
- DbConnectionPoolCounters.cs
- DeferredTextReference.cs
- TextTrailingWordEllipsis.cs
- DataGridViewComboBoxColumn.cs
- ErrorWebPart.cs
- InvokeMethodActivityDesigner.cs
- _Connection.cs
- SoapExtensionTypeElement.cs
- InertiaExpansionBehavior.cs
- Hash.cs
- WorkflowHostingEndpoint.cs
- Font.cs
- SqlServices.cs
- KnownBoxes.cs
- NamespaceMapping.cs
- UrlAuthFailedErrorFormatter.cs
- IssuanceTokenProviderState.cs
- IERequestCache.cs
- EntityDataSourceSelectingEventArgs.cs
- BaseCAMarshaler.cs
- TransformProviderWrapper.cs
- figurelengthconverter.cs
- RightsManagementInformation.cs
- ObjectListFieldCollection.cs
- HighlightVisual.cs
- PropertyTab.cs
- CompoundFileStreamReference.cs
- NotConverter.cs
- CompositeScriptReferenceEventArgs.cs
- InstanceDataCollectionCollection.cs
- PrintDialogException.cs
- CrossContextChannel.cs
- KeyFrames.cs
- XmlDictionaryReaderQuotas.cs
- CommandValueSerializer.cs
- FormsIdentity.cs
- DESCryptoServiceProvider.cs
- XmlTypeMapping.cs
- ImageField.cs
- FactoryGenerator.cs
- TCPClient.cs
- SafeLocalMemHandle.cs
- GlyphCollection.cs
- sortedlist.cs
- TextMarkerSource.cs
- EventEntry.cs
- ADConnectionHelper.cs
- FontSizeConverter.cs
- JavascriptXmlWriterWrapper.cs
- BinaryFormatter.cs
- RadioButtonPopupAdapter.cs
- ToolboxItemCollection.cs
- BaseTemplateParser.cs
- BindingManagerDataErrorEventArgs.cs
- CodeTypeConstructor.cs
- SiteOfOriginContainer.cs
- UDPClient.cs
- Margins.cs
- FilterQuery.cs
- Win32.cs
- EnvelopedPkcs7.cs
- SiteMapNodeItemEventArgs.cs
- ListViewItem.cs