Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- BoundingRectTracker.cs
- DictionaryContent.cs
- SchemaImporterExtensionsSection.cs
- WasHttpHandlersInstallComponent.cs
- BamlRecords.cs
- ToolBar.cs
- TypedDatasetGenerator.cs
- ContentDisposition.cs
- SiteMapHierarchicalDataSourceView.cs
- MarkupWriter.cs
- LineVisual.cs
- XmlWrappingReader.cs
- EventLog.cs
- HandlerWithFactory.cs
- MetricEntry.cs
- ConfigurationValues.cs
- AssemblyCacheEntry.cs
- DataControlImageButton.cs
- TripleDESCryptoServiceProvider.cs
- CommandDevice.cs
- VariableBinder.cs
- MetadataItem.cs
- LiteralControl.cs
- DateTimeFormatInfoScanner.cs
- XmlBinaryReader.cs
- LoadMessageLogger.cs
- RequestCachePolicy.cs
- BindingExpression.cs
- RemotingHelper.cs
- GridViewRowPresenterBase.cs
- CodeTypeDelegate.cs
- ThicknessKeyFrameCollection.cs
- DataSourceXmlElementAttribute.cs
- CalendarDateRange.cs
- UpDownBase.cs
- mediaeventargs.cs
- ObjectListSelectEventArgs.cs
- DataTableTypeConverter.cs
- SecurityHelper.cs
- GestureRecognitionResult.cs
- ToolboxComponentsCreatingEventArgs.cs
- HttpModulesSection.cs
- ReferenceConverter.cs
- TextBoxDesigner.cs
- FlowLayoutSettings.cs
- TextEndOfParagraph.cs
- DataSetMappper.cs
- CommandBinding.cs
- Size3DConverter.cs
- CursorConverter.cs
- BatchParser.cs
- Keyboard.cs
- controlskin.cs
- PeerResolverSettings.cs
- DoubleAnimation.cs
- UInt64Converter.cs
- UIElementParagraph.cs
- WorkflowMarkupElementEventArgs.cs
- FileInfo.cs
- AtomParser.cs
- ManagedIStream.cs
- CalendarDesigner.cs
- XmlObjectSerializerWriteContext.cs
- CreateUserWizardStep.cs
- COM2ExtendedBrowsingHandler.cs
- FileAuthorizationModule.cs
- DllNotFoundException.cs
- MdImport.cs
- Expression.DebuggerProxy.cs
- BasePattern.cs
- ProcessThread.cs
- HttpHandler.cs
- MultipartIdentifier.cs
- RectIndependentAnimationStorage.cs
- CompilerLocalReference.cs
- RightsManagementInformation.cs
- CachedBitmap.cs
- JournalEntry.cs
- Faults.cs
- XpsLiterals.cs
- Permission.cs
- QilVisitor.cs
- XamlStyleSerializer.cs
- ShapingWorkspace.cs
- SignalGate.cs
- StateDesigner.cs
- BooleanProjectedSlot.cs
- ApplicationException.cs
- XmlDataImplementation.cs
- QueryRelOp.cs
- ping.cs
- ObfuscationAttribute.cs
- WorkflowApplicationUnloadedException.cs
- PropertyEmitter.cs
- EntityDataSourceWrapper.cs
- ElementUtil.cs
- Stack.cs
- CodeDefaultValueExpression.cs
- HtmlInputButton.cs
- XsltSettings.cs