Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- UseAttributeSetsAction.cs
- IdnMapping.cs
- ListViewDeletedEventArgs.cs
- Vector3DCollectionValueSerializer.cs
- CursorConverter.cs
- HandlerMappingMemo.cs
- RedBlackList.cs
- CacheAxisQuery.cs
- ImageMap.cs
- ProtocolsConfigurationEntry.cs
- MenuBindingsEditorForm.cs
- CustomWebEventKey.cs
- FixedPageProcessor.cs
- RtType.cs
- Lock.cs
- SizeAnimation.cs
- DisplayInformation.cs
- TemplateComponentConnector.cs
- GenericXmlSecurityToken.cs
- XmlSchemaRedefine.cs
- SqlBinder.cs
- MultitargetUtil.cs
- StringPropertyBuilder.cs
- XmlSchemaInfo.cs
- COM2EnumConverter.cs
- X509KeyIdentifierClauseType.cs
- CommonObjectSecurity.cs
- HttpModuleActionCollection.cs
- sqlnorm.cs
- PrintingPermission.cs
- ClientConfigurationSystem.cs
- FixedTextPointer.cs
- RemoteX509AsymmetricSecurityKey.cs
- CodeThrowExceptionStatement.cs
- ExpandedWrapper.cs
- DBParameter.cs
- LongValidatorAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- AsyncResult.cs
- UiaCoreApi.cs
- XmlSchemaAnnotated.cs
- LineProperties.cs
- ColorConverter.cs
- XmlSequenceWriter.cs
- Logging.cs
- CodeValidator.cs
- CLSCompliantAttribute.cs
- IntegerFacetDescriptionElement.cs
- GlyphRun.cs
- XmlSchemaCollection.cs
- UnsupportedPolicyOptionsException.cs
- DesignerActionPropertyItem.cs
- ComponentResourceManager.cs
- LocatorBase.cs
- ResourceContainer.cs
- EndpointNameMessageFilter.cs
- ControlBindingsCollection.cs
- BasicDesignerLoader.cs
- XmlSchemas.cs
- XmlEnumAttribute.cs
- FormatStringEditor.cs
- UTF8Encoding.cs
- GeometryHitTestParameters.cs
- TimeIntervalCollection.cs
- CachedBitmap.cs
- ProcessHostFactoryHelper.cs
- GridViewSortEventArgs.cs
- ConnectionManagementSection.cs
- WsiProfilesElementCollection.cs
- ContextMenuStripActionList.cs
- SizeValueSerializer.cs
- dtdvalidator.cs
- activationcontext.cs
- VectorCollection.cs
- PartBasedPackageProperties.cs
- Calendar.cs
- embossbitmapeffect.cs
- NavigationWindow.cs
- DataBoundControlHelper.cs
- NativeCompoundFileAPIs.cs
- SqlConnectionManager.cs
- AuthenticatedStream.cs
- Misc.cs
- KeyConverter.cs
- Mutex.cs
- RectAnimationBase.cs
- TextBoxAutoCompleteSourceConverter.cs
- ReadOnlyDictionary.cs
- LineProperties.cs
- UnsafeNativeMethods.cs
- linebase.cs
- SystemIPInterfaceStatistics.cs
- RootAction.cs
- TriState.cs
- SpoolingTaskBase.cs
- DiscoveryClientElement.cs
- SafePEFileHandle.cs
- IFlowDocumentViewer.cs
- GeometryDrawing.cs
- ItemCollection.cs