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
- FullTextBreakpoint.cs
- TrackingRecord.cs
- TextTreeExtractElementUndoUnit.cs
- StubHelpers.cs
- TextTreeObjectNode.cs
- HttpException.cs
- RuntimeConfigLKG.cs
- ProcessModelSection.cs
- QilInvokeLateBound.cs
- EmissiveMaterial.cs
- FlowStep.cs
- ReachDocumentPageSerializer.cs
- Point3DCollectionConverter.cs
- SplitContainer.cs
- XsltArgumentList.cs
- PaginationProgressEventArgs.cs
- WebAdminConfigurationHelper.cs
- DataTransferEventArgs.cs
- DateTimeUtil.cs
- PointLight.cs
- UxThemeWrapper.cs
- XmlSchemaObjectTable.cs
- SqlCommandBuilder.cs
- Predicate.cs
- Maps.cs
- SecurityTokenSerializer.cs
- InternalResources.cs
- StringResourceManager.cs
- HttpCacheVaryByContentEncodings.cs
- ComponentTray.cs
- BindToObject.cs
- MetricEntry.cs
- PermissionSetEnumerator.cs
- Int16KeyFrameCollection.cs
- App.cs
- SizeIndependentAnimationStorage.cs
- CurrencyWrapper.cs
- BindingGroup.cs
- ThreadLocal.cs
- XamlStackWriter.cs
- Completion.cs
- EmptyImpersonationContext.cs
- DispatchWrapper.cs
- ServiceEndpointElement.cs
- Compiler.cs
- LinkLabel.cs
- WebBrowserProgressChangedEventHandler.cs
- StringSorter.cs
- DataSetMappper.cs
- ObjectContext.cs
- VBIdentifierTrimConverter.cs
- TraceRecords.cs
- XamlRtfConverter.cs
- NameObjectCollectionBase.cs
- CheckBoxDesigner.cs
- ViewBox.cs
- ScriptResourceHandler.cs
- BufferAllocator.cs
- ISessionStateStore.cs
- CqlQuery.cs
- ArrangedElement.cs
- DataGridViewCellMouseEventArgs.cs
- WebPartConnectionsCancelVerb.cs
- CodeConstructor.cs
- EventToken.cs
- OrCondition.cs
- SelectionRange.cs
- CommonGetThemePartSize.cs
- IRCollection.cs
- DBDataPermissionAttribute.cs
- FieldTemplateUserControl.cs
- ExtendedPropertyCollection.cs
- XmlSchemaSubstitutionGroup.cs
- Filter.cs
- SecurityPolicySection.cs
- GeneralTransformCollection.cs
- VSDExceptions.cs
- ObsoleteAttribute.cs
- WhitespaceReader.cs
- DependencyPropertyKind.cs
- ModelFunctionTypeElement.cs
- DataObjectAttribute.cs
- TransformProviderWrapper.cs
- ReadOnlyActivityGlyph.cs
- TypeUnloadedException.cs
- RangeContentEnumerator.cs
- HttpMethodConstraint.cs
- DataBindingCollection.cs
- IUnknownConstantAttribute.cs
- FlowDocumentFormatter.cs
- EventLogLink.cs
- MessageDescriptionCollection.cs
- EmptyQuery.cs
- UriScheme.cs
- GenericEnumerator.cs
- NumberSubstitution.cs
- RuleCache.cs
- MinimizableAttributeTypeConverter.cs
- UserPersonalizationStateInfo.cs
- AxHost.cs