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 / 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
- GridViewCommandEventArgs.cs
- DataContractSerializerSection.cs
- RecordConverter.cs
- TextPattern.cs
- NavigationEventArgs.cs
- CryptoApi.cs
- COSERVERINFO.cs
- LocalValueEnumerator.cs
- OverflowException.cs
- DataBinding.cs
- UnsafeNativeMethods.cs
- UrlMappingsSection.cs
- RenamedEventArgs.cs
- ComponentEditorForm.cs
- SelectorItemAutomationPeer.cs
- SoapEnvelopeProcessingElement.cs
- MenuStrip.cs
- TreeNodeStyle.cs
- ZipPackagePart.cs
- log.cs
- CalendarDay.cs
- CodeBlockBuilder.cs
- DecimalStorage.cs
- Encoder.cs
- ValidationErrorInfo.cs
- SamlAuthenticationStatement.cs
- WindowsFormsHost.cs
- UrlPropertyAttribute.cs
- XmlSignatureManifest.cs
- FuncCompletionCallbackWrapper.cs
- _IPv6Address.cs
- DBNull.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- RoutedUICommand.cs
- BinaryMethodMessage.cs
- SelectionListComponentEditor.cs
- InitializationEventAttribute.cs
- WorkflowTimerService.cs
- DataSvcMapFile.cs
- SQLChars.cs
- DbConnectionPoolGroupProviderInfo.cs
- PointConverter.cs
- SolidColorBrush.cs
- SchemaElementDecl.cs
- StylusPointProperty.cs
- CancellationTokenSource.cs
- HwndSourceParameters.cs
- ListViewItemSelectionChangedEvent.cs
- ProviderIncompatibleException.cs
- SiteMapNodeItem.cs
- AsyncStreamReader.cs
- ExpressionEditorAttribute.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ExpressionNormalizer.cs
- LoadGrammarCompletedEventArgs.cs
- SettingsPropertyValueCollection.cs
- AppDomain.cs
- ListenerElementsCollection.cs
- WebPartAuthorizationEventArgs.cs
- TreeNodeConverter.cs
- XmlSerializationReader.cs
- FontClient.cs
- Activity.cs
- ShellProvider.cs
- WeakReadOnlyCollection.cs
- EventBuilder.cs
- CustomTypeDescriptor.cs
- OverrideMode.cs
- XMLUtil.cs
- LambdaCompiler.Expressions.cs
- Positioning.cs
- SecurityPermission.cs
- CodeTypeReferenceSerializer.cs
- DriveInfo.cs
- Command.cs
- IdentityReference.cs
- OdbcConnectionFactory.cs
- TextServicesContext.cs
- PrefixHandle.cs
- TemplateParser.cs
- SoapInteropTypes.cs
- XmlReaderSettings.cs
- EmbeddedMailObjectsCollection.cs
- Point3DAnimationBase.cs
- ResourceAttributes.cs
- OptimalBreakSession.cs
- __ComObject.cs
- SingleObjectCollection.cs
- PageCache.cs
- WebPartZoneCollection.cs
- Stackframe.cs
- ValidationResult.cs
- Errors.cs
- DocumentPageHost.cs
- WebPartManagerInternals.cs
- ProfileEventArgs.cs
- WebBrowserProgressChangedEventHandler.cs
- PaintEvent.cs
- AesCryptoServiceProvider.cs
- WebPartExportVerb.cs