Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / NavigatorInput.cs / 1305376 / NavigatorInput.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 Keywords = System.Xml.Xsl.Xslt.KeywordsTable; internal class NavigatorInput { private XPathNavigator _Navigator; private PositionInfo _PositionInfo; private InputScopeManager _Manager; private NavigatorInput _Next; private string _Href; private Keywords _Atoms; internal NavigatorInput Next { get { return _Next; } set { _Next = value; } } internal string Href { get { return _Href; } } internal Keywords Atoms { get { return _Atoms; } } internal XPathNavigator Navigator { get { AssertInput(); return _Navigator; } } internal InputScopeManager InputScopeManager { get { AssertInput(); return _Manager; } } internal bool Advance() { AssertInput(); return _Navigator.MoveToNext(); } internal bool Recurse() { AssertInput(); return _Navigator.MoveToFirstChild(); } internal bool ToParent() { AssertInput(); return _Navigator.MoveToParent(); } internal void Close() { _Navigator = null; _PositionInfo = null; } // // Input document properties // // // XPathNavigator does not support line and position numbers // internal int LineNumber { get { return _PositionInfo.LineNumber; } } internal int LinePosition { get { return _PositionInfo.LinePosition; } } internal XPathNodeType NodeType { get { AssertInput(); return _Navigator.NodeType; } } internal string Name { get { AssertInput(); return _Navigator.Name; } } internal string LocalName { get { AssertInput(); return _Navigator.LocalName; } } internal string NamespaceURI { get { AssertInput(); return _Navigator.NamespaceURI; } } internal string Prefix { get { AssertInput(); return _Navigator.Prefix; } } internal string Value { get { AssertInput(); return _Navigator.Value; } } internal bool IsEmptyTag { get { AssertInput(); return _Navigator.IsEmptyElement; } } internal string BaseURI { get { return _Navigator.BaseURI; } } internal bool MoveToFirstAttribute() { AssertInput(); return _Navigator.MoveToFirstAttribute(); } internal bool MoveToNextAttribute() { AssertInput(); return _Navigator.MoveToNextAttribute(); } internal bool MoveToFirstNamespace() { AssertInput(); return _Navigator.MoveToFirstNamespace(XPathNamespaceScope.ExcludeXml); } internal bool MoveToNextNamespace() { AssertInput(); return _Navigator.MoveToNextNamespace(XPathNamespaceScope.ExcludeXml); } // // Constructor // internal NavigatorInput(XPathNavigator navigator, string baseUri, InputScope rootScope) { if (navigator == null) { throw new ArgumentNullException("navigator"); } if (baseUri == null) { throw new ArgumentNullException("baseUri"); } Debug.Assert(navigator.NameTable != null); _Next = null; _Href = baseUri; _Atoms = new Keywords(navigator.NameTable); _Navigator = navigator; _Manager = new InputScopeManager(_Navigator, rootScope); _PositionInfo = PositionInfo.GetPositionInfo(_Navigator); /*BeginReading:*/ AssertInput(); if (NodeType == XPathNodeType.Root) { _Navigator.MoveToFirstChild(); } } internal NavigatorInput(XPathNavigator navigator): this(navigator, navigator.BaseURI, null) {} // // Debugging support // [System.Diagnostics.Conditional("DEBUG")] internal void AssertInput() { Debug.Assert(_Navigator != null); } } } // 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 Keywords = System.Xml.Xsl.Xslt.KeywordsTable; internal class NavigatorInput { private XPathNavigator _Navigator; private PositionInfo _PositionInfo; private InputScopeManager _Manager; private NavigatorInput _Next; private string _Href; private Keywords _Atoms; internal NavigatorInput Next { get { return _Next; } set { _Next = value; } } internal string Href { get { return _Href; } } internal Keywords Atoms { get { return _Atoms; } } internal XPathNavigator Navigator { get { AssertInput(); return _Navigator; } } internal InputScopeManager InputScopeManager { get { AssertInput(); return _Manager; } } internal bool Advance() { AssertInput(); return _Navigator.MoveToNext(); } internal bool Recurse() { AssertInput(); return _Navigator.MoveToFirstChild(); } internal bool ToParent() { AssertInput(); return _Navigator.MoveToParent(); } internal void Close() { _Navigator = null; _PositionInfo = null; } // // Input document properties // // // XPathNavigator does not support line and position numbers // internal int LineNumber { get { return _PositionInfo.LineNumber; } } internal int LinePosition { get { return _PositionInfo.LinePosition; } } internal XPathNodeType NodeType { get { AssertInput(); return _Navigator.NodeType; } } internal string Name { get { AssertInput(); return _Navigator.Name; } } internal string LocalName { get { AssertInput(); return _Navigator.LocalName; } } internal string NamespaceURI { get { AssertInput(); return _Navigator.NamespaceURI; } } internal string Prefix { get { AssertInput(); return _Navigator.Prefix; } } internal string Value { get { AssertInput(); return _Navigator.Value; } } internal bool IsEmptyTag { get { AssertInput(); return _Navigator.IsEmptyElement; } } internal string BaseURI { get { return _Navigator.BaseURI; } } internal bool MoveToFirstAttribute() { AssertInput(); return _Navigator.MoveToFirstAttribute(); } internal bool MoveToNextAttribute() { AssertInput(); return _Navigator.MoveToNextAttribute(); } internal bool MoveToFirstNamespace() { AssertInput(); return _Navigator.MoveToFirstNamespace(XPathNamespaceScope.ExcludeXml); } internal bool MoveToNextNamespace() { AssertInput(); return _Navigator.MoveToNextNamespace(XPathNamespaceScope.ExcludeXml); } // // Constructor // internal NavigatorInput(XPathNavigator navigator, string baseUri, InputScope rootScope) { if (navigator == null) { throw new ArgumentNullException("navigator"); } if (baseUri == null) { throw new ArgumentNullException("baseUri"); } Debug.Assert(navigator.NameTable != null); _Next = null; _Href = baseUri; _Atoms = new Keywords(navigator.NameTable); _Navigator = navigator; _Manager = new InputScopeManager(_Navigator, rootScope); _PositionInfo = PositionInfo.GetPositionInfo(_Navigator); /*BeginReading:*/ AssertInput(); if (NodeType == XPathNodeType.Root) { _Navigator.MoveToFirstChild(); } } internal NavigatorInput(XPathNavigator navigator): this(navigator, navigator.BaseURI, null) {} // // Debugging support // [System.Diagnostics.Conditional("DEBUG")] internal void AssertInput() { Debug.Assert(_Navigator != null); } } } // 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
- KeyboardEventArgs.cs
- IPGlobalProperties.cs
- DocumentApplicationDocumentViewer.cs
- PatternMatcher.cs
- clipboard.cs
- ResourceDefaultValueAttribute.cs
- TimeSpanStorage.cs
- InstanceValue.cs
- ColorKeyFrameCollection.cs
- ThicknessAnimationBase.cs
- VScrollProperties.cs
- ThousandthOfEmRealDoubles.cs
- HandleRef.cs
- ScriptServiceAttribute.cs
- AmbientProperties.cs
- ThousandthOfEmRealPoints.cs
- _ProxyRegBlob.cs
- TypeReference.cs
- ReflectionUtil.cs
- ConstraintStruct.cs
- RuleSetCollection.cs
- DefaultTraceListener.cs
- ChangeDirector.cs
- XmlAtomicValue.cs
- PrintDialog.cs
- WebPartEditorOkVerb.cs
- LabelDesigner.cs
- UxThemeWrapper.cs
- ArrayWithOffset.cs
- KeyEvent.cs
- Operators.cs
- UIServiceHelper.cs
- TraceContextEventArgs.cs
- UnsafePeerToPeerMethods.cs
- StringValidator.cs
- StylusPoint.cs
- TextEditorCharacters.cs
- LocalizationCodeDomSerializer.cs
- GroupItem.cs
- SqlUtils.cs
- DiscoveryDocumentLinksPattern.cs
- CryptoKeySecurity.cs
- UIPermission.cs
- Size.cs
- SplitterEvent.cs
- NavigationWindow.cs
- ValidationHelper.cs
- RenderTargetBitmap.cs
- GroupBoxAutomationPeer.cs
- FileUtil.cs
- TimeStampChecker.cs
- relpropertyhelper.cs
- SerializationStore.cs
- Validator.cs
- BaseAutoFormat.cs
- ZipIOLocalFileHeader.cs
- SiteMapProvider.cs
- FlowDocumentScrollViewer.cs
- SingleTagSectionHandler.cs
- log.cs
- MappingModelBuildProvider.cs
- Int32RectConverter.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- NamedPipeAppDomainProtocolHandler.cs
- DbParameterHelper.cs
- PolicyReader.cs
- Effect.cs
- ThreadStateException.cs
- FragmentQueryKB.cs
- SiteMapNodeCollection.cs
- FixedTextContainer.cs
- xmlfixedPageInfo.cs
- UseAttributeSetsAction.cs
- TextHidden.cs
- FilterableAttribute.cs
- StyleSheetDesigner.cs
- XPathSingletonIterator.cs
- AdPostCacheSubstitution.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- CollectionChangeEventArgs.cs
- UserControlDesigner.cs
- EntityModelSchemaGenerator.cs
- HtmlTableCell.cs
- XmlTextAttribute.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- ValueProviderWrapper.cs
- AvTrace.cs
- _NestedSingleAsyncResult.cs
- MailDefinition.cs
- ClientTargetSection.cs
- Int32AnimationUsingKeyFrames.cs
- BindToObject.cs
- HostVisual.cs
- ProtocolsConfigurationEntry.cs
- StyleCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- QuotedStringFormatReader.cs
- DependencyPropertyChangedEventArgs.cs
- PersonalizationEntry.cs
- MultiPartWriter.cs