Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- WebPartDisplayMode.cs
- EntityViewContainer.cs
- WebPartZoneCollection.cs
- Image.cs
- HttpWebRequest.cs
- StringStorage.cs
- TypeGeneratedEventArgs.cs
- DesignerTransactionCloseEvent.cs
- ScrollChrome.cs
- BaseConfigurationRecord.cs
- TdsEnums.cs
- Attributes.cs
- XAMLParseException.cs
- BuildDependencySet.cs
- LayoutEvent.cs
- CommandBindingCollection.cs
- CaseStatementProjectedSlot.cs
- HttpApplication.cs
- SelectionItemProviderWrapper.cs
- FontSource.cs
- Security.cs
- FlowLayout.cs
- ValidatedMobileControlConverter.cs
- WmfPlaceableFileHeader.cs
- TextModifierScope.cs
- Certificate.cs
- MSAAWinEventWrap.cs
- Point3DValueSerializer.cs
- SequentialWorkflowRootDesigner.cs
- TextSelection.cs
- SystemKeyConverter.cs
- JpegBitmapEncoder.cs
- SparseMemoryStream.cs
- Int16Storage.cs
- WebControl.cs
- WindowsHyperlink.cs
- ComEventsInfo.cs
- StringCollection.cs
- SqlGenericUtil.cs
- DbDataReader.cs
- WindowsStatusBar.cs
- AccessorTable.cs
- SecureUICommand.cs
- FilteredReadOnlyMetadataCollection.cs
- DomNameTable.cs
- WebServiceFaultDesigner.cs
- ProfileSection.cs
- HistoryEventArgs.cs
- StickyNote.cs
- GB18030Encoding.cs
- ProtocolElementCollection.cs
- ViewService.cs
- Odbc32.cs
- ContentPosition.cs
- WriteLineDesigner.xaml.cs
- XmlRootAttribute.cs
- WebBrowser.cs
- LambdaValue.cs
- StringConverter.cs
- Int32Converter.cs
- InkSerializer.cs
- EdmComplexPropertyAttribute.cs
- FileEnumerator.cs
- WebPartConnectionsCloseVerb.cs
- RecognizerBase.cs
- TableLayoutPanel.cs
- MailMessageEventArgs.cs
- ApplicationActivator.cs
- SqlCacheDependencySection.cs
- RequestValidator.cs
- KeyBinding.cs
- IImplicitResourceProvider.cs
- PocoEntityKeyStrategy.cs
- ReflectionTypeLoadException.cs
- GeneralTransformCollection.cs
- UIElementParaClient.cs
- Run.cs
- StylusEventArgs.cs
- HandlerFactoryCache.cs
- BufferedGraphicsContext.cs
- DocumentSchemaValidator.cs
- XmlIterators.cs
- DBNull.cs
- UIElementHelper.cs
- updateconfighost.cs
- XPathNavigator.cs
- SpeechUI.cs
- OSFeature.cs
- DataControlImageButton.cs
- DataGridViewTextBoxCell.cs
- RawStylusSystemGestureInputReport.cs
- UTF32Encoding.cs
- GlyphTypeface.cs
- EdmEntityTypeAttribute.cs
- DataGridTable.cs
- DataServiceRequestOfT.cs
- DependencyPropertyKey.cs
- TransformDescriptor.cs
- EntitySet.cs
- Pool.cs