Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / InputScope.cs / 1 / InputScope.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Xml; using System.Xml.XPath; using System.Collections; internal class InputScope : DocumentScope { private InputScope parent; private bool forwardCompatibility; private bool canHaveApplyImports; private Hashtable variables; private Hashtable extensionNamespaces; private Hashtable excludedNamespaces; internal InputScope Parent { get { return this.parent; } } internal Hashtable Variables { get { return this.variables; } } internal bool ForwardCompatibility { get { return this.forwardCompatibility; } set { this.forwardCompatibility = value; } } internal bool CanHaveApplyImports { get { return this.canHaveApplyImports; } set { this.canHaveApplyImports = value; } } internal InputScope(InputScope parent) { Init(parent); } internal void Init(InputScope parent) { this.scopes = null; this.parent = parent; if (this.parent != null) { this.forwardCompatibility = this.parent.forwardCompatibility; this.canHaveApplyImports = this.parent.canHaveApplyImports; } } internal void InsertExtensionNamespace(String nspace) { if (this.extensionNamespaces == null ) { this.extensionNamespaces = new Hashtable(); } this.extensionNamespaces[nspace] = null; } internal bool IsExtensionNamespace(String nspace) { if (extensionNamespaces == null ) { return false; } return extensionNamespaces.Contains(nspace); } internal void InsertExcludedNamespace(String nspace) { if (this.excludedNamespaces == null ) { this.excludedNamespaces = new Hashtable(); } this.excludedNamespaces[nspace] = null; } internal bool IsExcludedNamespace(String nspace) { if (excludedNamespaces == null ) { return false; } return excludedNamespaces.Contains(nspace); } internal void InsertVariable(VariableAction variable) { Debug.Assert(variable != null); if (this.variables == null) { this.variables = new Hashtable(); } this.variables[variable.Name] = variable; } internal int GetVeriablesCount() { if (this.variables == null) { return 0; } return this.variables.Count; } public VariableAction ResolveVariable(XmlQualifiedName qname) { for (InputScope inputScope = this; inputScope != null; inputScope = inputScope.Parent) { if (inputScope.Variables != null) { VariableAction variable = (VariableAction) inputScope.Variables[qname]; if(variable != null) { return variable; } } } return null; } public VariableAction ResolveGlobalVariable(XmlQualifiedName qname) { InputScope prevScope = null; for (InputScope inputScope = this; inputScope != null; inputScope = inputScope.Parent) { prevScope = inputScope; } return prevScope.ResolveVariable(qname); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Xml; using System.Xml.XPath; using System.Collections; internal class InputScope : DocumentScope { private InputScope parent; private bool forwardCompatibility; private bool canHaveApplyImports; private Hashtable variables; private Hashtable extensionNamespaces; private Hashtable excludedNamespaces; internal InputScope Parent { get { return this.parent; } } internal Hashtable Variables { get { return this.variables; } } internal bool ForwardCompatibility { get { return this.forwardCompatibility; } set { this.forwardCompatibility = value; } } internal bool CanHaveApplyImports { get { return this.canHaveApplyImports; } set { this.canHaveApplyImports = value; } } internal InputScope(InputScope parent) { Init(parent); } internal void Init(InputScope parent) { this.scopes = null; this.parent = parent; if (this.parent != null) { this.forwardCompatibility = this.parent.forwardCompatibility; this.canHaveApplyImports = this.parent.canHaveApplyImports; } } internal void InsertExtensionNamespace(String nspace) { if (this.extensionNamespaces == null ) { this.extensionNamespaces = new Hashtable(); } this.extensionNamespaces[nspace] = null; } internal bool IsExtensionNamespace(String nspace) { if (extensionNamespaces == null ) { return false; } return extensionNamespaces.Contains(nspace); } internal void InsertExcludedNamespace(String nspace) { if (this.excludedNamespaces == null ) { this.excludedNamespaces = new Hashtable(); } this.excludedNamespaces[nspace] = null; } internal bool IsExcludedNamespace(String nspace) { if (excludedNamespaces == null ) { return false; } return excludedNamespaces.Contains(nspace); } internal void InsertVariable(VariableAction variable) { Debug.Assert(variable != null); if (this.variables == null) { this.variables = new Hashtable(); } this.variables[variable.Name] = variable; } internal int GetVeriablesCount() { if (this.variables == null) { return 0; } return this.variables.Count; } public VariableAction ResolveVariable(XmlQualifiedName qname) { for (InputScope inputScope = this; inputScope != null; inputScope = inputScope.Parent) { if (inputScope.Variables != null) { VariableAction variable = (VariableAction) inputScope.Variables[qname]; if(variable != null) { return variable; } } } return null; } public VariableAction ResolveGlobalVariable(XmlQualifiedName qname) { InputScope prevScope = null; for (InputScope inputScope = this; inputScope != null; inputScope = inputScope.Parent) { prevScope = inputScope; } return prevScope.ResolveVariable(qname); } } } // 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
- Dispatcher.cs
- WebScriptMetadataInstanceContextProvider.cs
- IApplicationTrustManager.cs
- WebDescriptionAttribute.cs
- SynchronizationScope.cs
- Wizard.cs
- XmlStreamNodeWriter.cs
- HyperLink.cs
- SchemaTableOptionalColumn.cs
- HandleExceptionArgs.cs
- CreatingCookieEventArgs.cs
- LazyTextWriterCreator.cs
- OleDbConnection.cs
- BitFlagsGenerator.cs
- SchemaImporterExtensionElementCollection.cs
- LoadWorkflowAsyncResult.cs
- DbException.cs
- HiddenFieldPageStatePersister.cs
- XmlStrings.cs
- DetailsViewRowCollection.cs
- FontFamily.cs
- TableColumnCollectionInternal.cs
- SymbolMethod.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- XmlDigitalSignatureProcessor.cs
- LinearGradientBrush.cs
- XslAstAnalyzer.cs
- UnsafeNativeMethodsMilCoreApi.cs
- XmlSchemaAnnotated.cs
- StreamResourceInfo.cs
- MembershipAdapter.cs
- ZipIOFileItemStream.cs
- EntityDesignPluralizationHandler.cs
- _OSSOCK.cs
- Flowchart.cs
- ObjectPersistData.cs
- NamespaceQuery.cs
- AppearanceEditorPart.cs
- WindowsSecurityToken.cs
- ObjectStateFormatter.cs
- EntityTransaction.cs
- OracleBinary.cs
- CodeValidator.cs
- XmlSchemaAll.cs
- ToolStripSplitStackLayout.cs
- ImageListImageEditor.cs
- ZipIOExtraField.cs
- PointCollection.cs
- TreeNodeStyle.cs
- SqlDataSourceQueryEditor.cs
- SemanticResultValue.cs
- TagNameToTypeMapper.cs
- COM2TypeInfoProcessor.cs
- CatalogPart.cs
- PropertyConverter.cs
- RectAnimationBase.cs
- Qualifier.cs
- ApplyImportsAction.cs
- AttachmentCollection.cs
- Unit.cs
- Simplifier.cs
- FontDriver.cs
- RightsManagementEncryptedStream.cs
- TableRow.cs
- ActiveXContainer.cs
- BamlCollectionHolder.cs
- GeometryGroup.cs
- ListBindingConverter.cs
- Base64Stream.cs
- XPathParser.cs
- ActivityStatusChangeEventArgs.cs
- RowBinding.cs
- SecurityPolicySection.cs
- ELinqQueryState.cs
- XmlImplementation.cs
- ClientRuntimeConfig.cs
- SystemIPv6InterfaceProperties.cs
- SqlTransaction.cs
- GradientStop.cs
- FixedDocument.cs
- DoubleAnimationBase.cs
- SymbolEqualComparer.cs
- SmtpReplyReaderFactory.cs
- TypedMessageConverter.cs
- RegexCapture.cs
- Vector.cs
- LayoutEditorPart.cs
- COM2PropertyPageUITypeConverter.cs
- Stream.cs
- TextTreeNode.cs
- WebPartUserCapability.cs
- SecurityManager.cs
- OleDbFactory.cs
- XmlSchemaAny.cs
- PointValueSerializer.cs
- LiteralControl.cs
- XmlSchemaFacet.cs
- ApplicationSecurityManager.cs
- ConfigXmlComment.cs
- PageContentAsyncResult.cs