Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / QIL / QilFunction.cs / 1305376 / 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
- SafeCryptHandles.cs
- WindowsStatusBar.cs
- _DigestClient.cs
- AccessDataSource.cs
- CodeGenerator.cs
- ReadWriteSpinLock.cs
- DataContractJsonSerializer.cs
- ImageConverter.cs
- XmlProcessingInstruction.cs
- BlurBitmapEffect.cs
- MissingFieldException.cs
- Native.cs
- Screen.cs
- ObjectDataSourceEventArgs.cs
- URLIdentityPermission.cs
- FileRegion.cs
- XmlMtomReader.cs
- DateRangeEvent.cs
- ComplexObject.cs
- EntityDataSourceSelectingEventArgs.cs
- IconConverter.cs
- UpDownEvent.cs
- COM2EnumConverter.cs
- ResumeStoryboard.cs
- QueryAccessibilityHelpEvent.cs
- ForwardPositionQuery.cs
- SqlDependencyUtils.cs
- WindowsSysHeader.cs
- MultiView.cs
- ComPlusServiceHost.cs
- ObjectParameterCollection.cs
- TextServicesHost.cs
- ObjectSet.cs
- XmlNamespaceManager.cs
- ComAdminInterfaces.cs
- StringComparer.cs
- OSFeature.cs
- NeutralResourcesLanguageAttribute.cs
- Visitors.cs
- DependencySource.cs
- AppDomain.cs
- CredentialCache.cs
- NameService.cs
- AuthorizationRuleCollection.cs
- Literal.cs
- RenderingEventArgs.cs
- StreamUpgradeInitiator.cs
- HandleCollector.cs
- safelink.cs
- DataListComponentEditor.cs
- NativeMethods.cs
- StateWorkerRequest.cs
- SafePEFileHandle.cs
- QueryTaskGroupState.cs
- SchemaNames.cs
- XmlTextReader.cs
- ImageListDesigner.cs
- ColumnCollectionEditor.cs
- WriteTimeStream.cs
- SoapCodeExporter.cs
- SamlAttributeStatement.cs
- Encoder.cs
- WebPartConnectVerb.cs
- AccessControlEntry.cs
- SeekableMessageNavigator.cs
- Token.cs
- PerfService.cs
- PassportAuthenticationModule.cs
- WebPartMovingEventArgs.cs
- UnknownWrapper.cs
- ReachUIElementCollectionSerializerAsync.cs
- StartUpEventArgs.cs
- SQLDecimal.cs
- VirtualDirectoryMapping.cs
- XmlUtilWriter.cs
- TimeEnumHelper.cs
- PenThreadPool.cs
- XmlTextAttribute.cs
- EasingFunctionBase.cs
- ToolBarTray.cs
- UriScheme.cs
- SelectedCellsChangedEventArgs.cs
- NativeMethods.cs
- SafeNativeMethods.cs
- TabPageDesigner.cs
- ParallelLoopState.cs
- PageTheme.cs
- TemplateAction.cs
- RowVisual.cs
- ForwardPositionQuery.cs
- XmlAttributeCache.cs
- ToolStripGripRenderEventArgs.cs
- TimeSpanMinutesConverter.cs
- SiteMapNodeItemEventArgs.cs
- Soap.cs
- WindowsAuthenticationModule.cs
- _BaseOverlappedAsyncResult.cs
- AnnotationHighlightLayer.cs
- RequestCache.cs
- InheritanceContextHelper.cs