Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / QIL / QilFunction.cs / 1 / QilFunction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; namespace System.Xml.Xsl.Qil { ////// An anonymous QilExpression function node. /// ////// internal class QilFunction : QilReference { private QilNode arguments, definition, sideEffects; //----------------------------------------------- // Constructor //----------------------------------------------- ///Function is a block, so it may introduce assignments (scoped to the function body). /// Additionally, it has an argument list, which will be assigned values /// when the function is invoked. ///The XmlType property defines the expected return type of this function. /// Normally, this should be the same as its definition's types, so setting the function /// definition changes the function's types. In some rare cases, a compiler may wish to /// override the types after setting the function's definition (for example, an XQuery /// might define a function's return type to be wider than its definition would imply.) ////// Construct a node /// public QilFunction(QilNodeType nodeType, QilNode arguments, QilNode definition, QilNode sideEffects, XmlQueryType resultType) : base(nodeType) { this.arguments = arguments; this.definition = definition; this.sideEffects = sideEffects; this.xmlType = resultType; } //----------------------------------------------- // IListmethods -- override //----------------------------------------------- public override int Count { get { return 3; } } public override QilNode this[int index] { get { switch (index) { case 0: return this.arguments; case 1: return this.definition; case 2: return this.sideEffects; default: throw new IndexOutOfRangeException(); } } set { switch (index) { case 0: this.arguments = value; break; case 1: this.definition = value; break; case 2: this.sideEffects = value; break; default: throw new IndexOutOfRangeException(); } } } //----------------------------------------------- // QilFunction methods //----------------------------------------------- /// /// Formal arguments of this function. /// public QilList Arguments { get { return (QilList) this.arguments; } set { this.arguments = value; } } ////// Body of this function. /// public QilNode Definition { get { return this.definition; } set { this.definition = value; } } ////// QilNodeType.True if this function might have side-effects. /// public bool MaybeSideEffects { get { return this.sideEffects.NodeType == QilNodeType.True; } set { this.sideEffects.NodeType = value ? QilNodeType.True : QilNodeType.False; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; namespace System.Xml.Xsl.Qil { ////// An anonymous QilExpression function node. /// ////// internal class QilFunction : QilReference { private QilNode arguments, definition, sideEffects; //----------------------------------------------- // Constructor //----------------------------------------------- ///Function is a block, so it may introduce assignments (scoped to the function body). /// Additionally, it has an argument list, which will be assigned values /// when the function is invoked. ///The XmlType property defines the expected return type of this function. /// Normally, this should be the same as its definition's types, so setting the function /// definition changes the function's types. In some rare cases, a compiler may wish to /// override the types after setting the function's definition (for example, an XQuery /// might define a function's return type to be wider than its definition would imply.) ////// Construct a node /// public QilFunction(QilNodeType nodeType, QilNode arguments, QilNode definition, QilNode sideEffects, XmlQueryType resultType) : base(nodeType) { this.arguments = arguments; this.definition = definition; this.sideEffects = sideEffects; this.xmlType = resultType; } //----------------------------------------------- // IListmethods -- override //----------------------------------------------- public override int Count { get { return 3; } } public override QilNode this[int index] { get { switch (index) { case 0: return this.arguments; case 1: return this.definition; case 2: return this.sideEffects; default: throw new IndexOutOfRangeException(); } } set { switch (index) { case 0: this.arguments = value; break; case 1: this.definition = value; break; case 2: this.sideEffects = value; break; default: throw new IndexOutOfRangeException(); } } } //----------------------------------------------- // QilFunction methods //----------------------------------------------- /// /// Formal arguments of this function. /// public QilList Arguments { get { return (QilList) this.arguments; } set { this.arguments = value; } } ////// Body of this function. /// public QilNode Definition { get { return this.definition; } set { this.definition = value; } } ////// QilNodeType.True if this function might have side-effects. /// public bool MaybeSideEffects { get { return this.sideEffects.NodeType == QilNodeType.True; } set { this.sideEffects.NodeType = value ? QilNodeType.True : QilNodeType.False; } } } } // 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
- FixedSOMTable.cs
- CollectionType.cs
- DesignTimeParseData.cs
- PersistenceTypeAttribute.cs
- FormatConvertedBitmap.cs
- PasswordValidationException.cs
- ImageAttributes.cs
- XsltQilFactory.cs
- CodeMemberProperty.cs
- SchemaTypeEmitter.cs
- DiscoveryDocumentSearchPattern.cs
- HtmlHistory.cs
- ContractMethodParameterInfo.cs
- DataService.cs
- EndpointReference.cs
- SimpleTextLine.cs
- ImageField.cs
- TransformConverter.cs
- ContextActivityUtils.cs
- StylusCollection.cs
- _AcceptOverlappedAsyncResult.cs
- MeasureItemEvent.cs
- SqlMetaData.cs
- WindowVisualStateTracker.cs
- CacheOutputQuery.cs
- RectangleConverter.cs
- XmlComplianceUtil.cs
- AssemblyAttributes.cs
- ImageMetadata.cs
- DataGridItemEventArgs.cs
- XmlTextEncoder.cs
- Collection.cs
- WindowsListViewGroupHelper.cs
- OutputScopeManager.cs
- CodeIdentifier.cs
- RoutedEventHandlerInfo.cs
- SqlCrossApplyToCrossJoin.cs
- NamespaceMapping.cs
- Asn1IntegerConverter.cs
- ControlSerializer.cs
- XmlSchemaSet.cs
- TableAutomationPeer.cs
- ToolStripSettings.cs
- RouteTable.cs
- InkPresenter.cs
- StylusPointPropertyInfoDefaults.cs
- XmlElementAttributes.cs
- ImageCodecInfo.cs
- ToolStripDropDownClosingEventArgs.cs
- TextFindEngine.cs
- WindowsFormsLinkLabel.cs
- DynamicDiscoSearcher.cs
- Win32SafeHandles.cs
- AnimationClockResource.cs
- ImageButton.cs
- ParameterDataSourceExpression.cs
- ResourceAssociationSetEnd.cs
- NumericPagerField.cs
- SafePipeHandle.cs
- DataRowChangeEvent.cs
- MessageSmuggler.cs
- CoTaskMemHandle.cs
- Configuration.cs
- HealthMonitoringSectionHelper.cs
- ViewService.cs
- ErrorRuntimeConfig.cs
- ConstrainedDataObject.cs
- MimeTypeAttribute.cs
- QueryableDataSource.cs
- MediaElementAutomationPeer.cs
- EntityObject.cs
- IconConverter.cs
- ContainerVisual.cs
- OrderByQueryOptionExpression.cs
- HtmlAnchor.cs
- precedingquery.cs
- PackageDigitalSignature.cs
- ISAPIApplicationHost.cs
- TypedTableBase.cs
- ToolStripSystemRenderer.cs
- EventTask.cs
- CollectionContainer.cs
- ExceptQueryOperator.cs
- PointCollectionConverter.cs
- MemoryStream.cs
- RunClient.cs
- UpdateEventArgs.cs
- DoubleAnimationUsingPath.cs
- DependencySource.cs
- ControlBuilderAttribute.cs
- ConstantCheck.cs
- Crypto.cs
- DataGridViewCellStyleChangedEventArgs.cs
- CursorConverter.cs
- RealProxy.cs
- DataGridViewRowConverter.cs
- DataGridViewColumnConverter.cs
- EditableTreeList.cs
- X509Certificate2.cs
- SizeChangedInfo.cs