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
- ResourceProviderFactory.cs
- MultipleCopiesCollection.cs
- SoapMessage.cs
- PresentationAppDomainManager.cs
- ContentIterators.cs
- CFStream.cs
- ObjectTypeMapping.cs
- FormClosingEvent.cs
- MultiView.cs
- Monitor.cs
- PropertyOverridesTypeEditor.cs
- FormViewPageEventArgs.cs
- RotateTransform3D.cs
- DataPagerField.cs
- StringAnimationBase.cs
- ISCIIEncoding.cs
- HttpServerVarsCollection.cs
- InstanceDescriptor.cs
- CopyNamespacesAction.cs
- mil_commands.cs
- IdentityValidationException.cs
- _SSPISessionCache.cs
- AspNetSynchronizationContext.cs
- Compiler.cs
- CheckBox.cs
- ContourSegment.cs
- GridViewCommandEventArgs.cs
- StandardToolWindows.cs
- SmtpAuthenticationManager.cs
- MemberCollection.cs
- InvalidOleVariantTypeException.cs
- SrgsText.cs
- PageStatePersister.cs
- LoginCancelEventArgs.cs
- CultureInfo.cs
- RNGCryptoServiceProvider.cs
- Comparer.cs
- TreeNodeBindingCollection.cs
- PersonalizationAdministration.cs
- CheckBox.cs
- OlePropertyStructs.cs
- ProxyElement.cs
- CodeDelegateCreateExpression.cs
- Trace.cs
- TryExpression.cs
- EventMetadata.cs
- CollectionExtensions.cs
- InputReportEventArgs.cs
- ToolStripSystemRenderer.cs
- IList.cs
- HMACSHA384.cs
- XMLSyntaxException.cs
- DecodeHelper.cs
- ProfilePropertySettingsCollection.cs
- DataGridViewHeaderCell.cs
- TypeNameParser.cs
- FormViewInsertedEventArgs.cs
- PrintControllerWithStatusDialog.cs
- IdentitySection.cs
- ImageMapEventArgs.cs
- MatchNoneMessageFilter.cs
- BuildResultCache.cs
- UiaCoreApi.cs
- PassportAuthenticationEventArgs.cs
- ToolboxItemLoader.cs
- ImageListImage.cs
- Helpers.cs
- PixelFormatConverter.cs
- OdbcUtils.cs
- DataSetFieldSchema.cs
- XmlFormatWriterGenerator.cs
- Page.cs
- BaseTemplateBuildProvider.cs
- LinkLabelLinkClickedEvent.cs
- SimpleBitVector32.cs
- CapabilitiesState.cs
- ACL.cs
- translator.cs
- AddInAttribute.cs
- MobileTemplatedControlDesigner.cs
- PartialCachingControl.cs
- XamlHostingConfiguration.cs
- ErrorStyle.cs
- TimelineCollection.cs
- AsymmetricSignatureDeformatter.cs
- AutoGeneratedField.cs
- ProviderManager.cs
- DataRow.cs
- sitestring.cs
- DummyDataSource.cs
- SettingsSection.cs
- ExpressionsCollectionEditor.cs
- EncryptedPackageFilter.cs
- AnnotationResourceCollection.cs
- ColorMap.cs
- SortQuery.cs
- EmptyControlCollection.cs
- SqlTypesSchemaImporter.cs
- SocketConnection.cs
- ListCommandEventArgs.cs