Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / InputScope.cs / 1305376 / 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
- TransformationRules.cs
- _KerberosClient.cs
- BitArray.cs
- PrintDialogDesigner.cs
- TraceSection.cs
- Point3D.cs
- CaseInsensitiveComparer.cs
- TextDecoration.cs
- KnownBoxes.cs
- XmlSerializerSection.cs
- EpmContentDeSerializerBase.cs
- ResourcePool.cs
- RijndaelManagedTransform.cs
- DataGridItemCollection.cs
- DisableDpiAwarenessAttribute.cs
- DataGridViewRowPrePaintEventArgs.cs
- KeyValueConfigurationCollection.cs
- UnsafeNativeMethods.cs
- VisualTreeHelper.cs
- ConstrainedDataObject.cs
- WizardStepBase.cs
- CellCreator.cs
- Clipboard.cs
- SoapAttributeAttribute.cs
- ToolStripItemEventArgs.cs
- KeyManager.cs
- AssemblyCache.cs
- ImageSourceConverter.cs
- DataTemplateKey.cs
- BindingList.cs
- WmlPageAdapter.cs
- X509SecurityToken.cs
- VerificationAttribute.cs
- safelinkcollection.cs
- FilterElement.cs
- XmlChoiceIdentifierAttribute.cs
- ToolbarAUtomationPeer.cs
- XmlAttributeOverrides.cs
- EntityWithKeyStrategy.cs
- ToolStripManager.cs
- PrefixQName.cs
- EmbeddedMailObjectsCollection.cs
- WebPartEditorOkVerb.cs
- TreeIterator.cs
- SymmetricAlgorithm.cs
- CodeAttributeDeclaration.cs
- NumericUpDownAccelerationCollection.cs
- HtmlGenericControl.cs
- WindowsGraphicsCacheManager.cs
- GeometryHitTestResult.cs
- PolyLineSegment.cs
- DatePickerDateValidationErrorEventArgs.cs
- ConsumerConnectionPointCollection.cs
- XmlSecureResolver.cs
- ObjectListCommandEventArgs.cs
- VBCodeProvider.cs
- WindowsListBox.cs
- SecUtil.cs
- CryptoStream.cs
- CloudCollection.cs
- TerminatorSinks.cs
- UIElementParaClient.cs
- RequestQueue.cs
- StorageEntitySetMapping.cs
- BindableAttribute.cs
- Visitors.cs
- SingleAnimation.cs
- ToolStripHighContrastRenderer.cs
- DesignerTransaction.cs
- UrlUtility.cs
- DocobjHost.cs
- DbConnectionPoolGroupProviderInfo.cs
- XmlWrappingWriter.cs
- EmptyStringExpandableObjectConverter.cs
- SamlNameIdentifierClaimResource.cs
- mil_commands.cs
- AuthenticationModulesSection.cs
- WebPartMinimizeVerb.cs
- TypeConvertions.cs
- Point3DKeyFrameCollection.cs
- HttpNamespaceReservationInstallComponent.cs
- TextFormatterImp.cs
- CodeNamespaceImport.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- DesignSurface.cs
- ListViewAutomationPeer.cs
- OptionalRstParameters.cs
- QuinticEase.cs
- WeakReadOnlyCollection.cs
- COAUTHINFO.cs
- RectAnimationBase.cs
- ListBoxItem.cs
- FormViewCommandEventArgs.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- TextProperties.cs
- FontDialog.cs
- AuditLog.cs
- Monitor.cs
- ApplicationTrust.cs
- XmlMessageFormatter.cs