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
- TrustManagerPromptUI.cs
- PartitionResolver.cs
- PageRanges.cs
- SqlHelper.cs
- ScriptBehaviorDescriptor.cs
- XpsResourceDictionary.cs
- Deflater.cs
- FreezableDefaultValueFactory.cs
- ToolStripProgressBar.cs
- DatagridviewDisplayedBandsData.cs
- VisualBasicSettings.cs
- StopRoutingHandler.cs
- XPathNodePointer.cs
- UnsafePeerToPeerMethods.cs
- FontClient.cs
- PrintDocument.cs
- MsmqAppDomainProtocolHandler.cs
- DragDrop.cs
- OutOfProcStateClientManager.cs
- SessionViewState.cs
- WebConfigurationHost.cs
- SqlUtils.cs
- RefreshPropertiesAttribute.cs
- Calendar.cs
- FontStretch.cs
- SchemaCollectionPreprocessor.cs
- FixedHighlight.cs
- WorkflowFileItem.cs
- streamingZipPartStream.cs
- Button.cs
- WebPartDescriptionCollection.cs
- PathData.cs
- ProcessModelInfo.cs
- COM2ComponentEditor.cs
- Array.cs
- IPHostEntry.cs
- IDispatchConstantAttribute.cs
- ColumnResizeUndoUnit.cs
- CmsInterop.cs
- Version.cs
- AsymmetricKeyExchangeDeformatter.cs
- DurationConverter.cs
- TrackBar.cs
- ToolboxDataAttribute.cs
- ChangePassword.cs
- DocumentReference.cs
- DateTimeFormatInfo.cs
- CodeEntryPointMethod.cs
- CountdownEvent.cs
- Stylus.cs
- LinkLabelLinkClickedEvent.cs
- CurrentTimeZone.cs
- AccessibleObject.cs
- TryLoadRunnableWorkflowCommand.cs
- WebPartEditorCancelVerb.cs
- InfiniteIntConverter.cs
- RemotingServices.cs
- Compilation.cs
- OutputCacheModule.cs
- Serializer.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- TextSelectionHighlightLayer.cs
- ObjectSet.cs
- LabelLiteral.cs
- TemplateKey.cs
- CacheDict.cs
- SqlAliaser.cs
- HttpRequestCacheValidator.cs
- OleDbCommandBuilder.cs
- MimeObjectFactory.cs
- FrameworkPropertyMetadata.cs
- PopupControlService.cs
- UpdatePanelControlTrigger.cs
- XomlDesignerLoader.cs
- ParentQuery.cs
- SourceItem.cs
- CfgRule.cs
- Page.cs
- TcpDuplicateContext.cs
- DetailsViewPageEventArgs.cs
- LocalizeDesigner.cs
- RegexMatch.cs
- CircleHotSpot.cs
- _LoggingObject.cs
- X509CertificateValidator.cs
- SecurityManager.cs
- LayoutEditorPart.cs
- CommentAction.cs
- DataGridViewEditingControlShowingEventArgs.cs
- XmlAnyAttributeAttribute.cs
- CodeTypeReferenceSerializer.cs
- RectangleGeometry.cs
- ValidatingPropertiesEventArgs.cs
- Application.cs
- ErrorLog.cs
- BitmapEffectvisualstate.cs
- StylusTip.cs
- CommandEventArgs.cs
- MarshalDirectiveException.cs
- AnnotationStore.cs