Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / NavigatorInput.cs / 1 / 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;
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);
_Atoms.LookupKeywords();
_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;
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);
_Atoms.LookupKeywords();
_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
- GridViewUpdatedEventArgs.cs
- XmlCharCheckingReader.cs
- Rect3D.cs
- TextSerializer.cs
- CookielessHelper.cs
- HotSpot.cs
- MouseGesture.cs
- input.cs
- ControlIdConverter.cs
- NotifyIcon.cs
- ZipIOLocalFileBlock.cs
- ResourcePart.cs
- ContractSearchPattern.cs
- TableFieldsEditor.cs
- IDReferencePropertyAttribute.cs
- FormClosingEvent.cs
- TextBlockAutomationPeer.cs
- FixedPageAutomationPeer.cs
- FlagsAttribute.cs
- Registry.cs
- RegistryKey.cs
- PageOutputColor.cs
- LowerCaseStringConverter.cs
- DataRelation.cs
- ExtensionSimplifierMarkupObject.cs
- ArraySubsetEnumerator.cs
- MouseGestureConverter.cs
- XsltOutput.cs
- XmlElementList.cs
- SamlSecurityToken.cs
- FormsAuthenticationCredentials.cs
- SpeakCompletedEventArgs.cs
- OracleNumber.cs
- XpsManager.cs
- RSAOAEPKeyExchangeDeformatter.cs
- HttpCapabilitiesBase.cs
- CursorConverter.cs
- Line.cs
- RouteData.cs
- ValueConversionAttribute.cs
- ScaleTransform3D.cs
- GenericUriParser.cs
- TextSelectionHighlightLayer.cs
- DataSourceHelper.cs
- FlagsAttribute.cs
- ZoneButton.cs
- StreamReader.cs
- TemplateBindingExtension.cs
- ObjectQuery_EntitySqlExtensions.cs
- SplitterCancelEvent.cs
- RemoteWebConfigurationHostStream.cs
- XmlAggregates.cs
- RuntimeArgumentHandle.cs
- ContractUtils.cs
- CapabilitiesSection.cs
- PersonalizationStateInfo.cs
- HTTPNotFoundHandler.cs
- RelationshipType.cs
- DataControlFieldHeaderCell.cs
- InstanceOwnerQueryResult.cs
- UIElementHelper.cs
- AppDomainResourcePerfCounters.cs
- BuildProvider.cs
- ProtocolsConfigurationEntry.cs
- OutputCacheModule.cs
- TheQuery.cs
- ProviderBase.cs
- GridToolTip.cs
- SubclassTypeValidator.cs
- IListConverters.cs
- ObjectDataSourceView.cs
- ExecutionContext.cs
- Size.cs
- LineServicesCallbacks.cs
- ServerIdentity.cs
- MSG.cs
- BindingSource.cs
- PermissionToken.cs
- X509PeerCertificateAuthentication.cs
- CannotUnloadAppDomainException.cs
- ConnectionPoolRegistry.cs
- DrawListViewSubItemEventArgs.cs
- DelayedRegex.cs
- OracleCommand.cs
- FixedPage.cs
- OdbcError.cs
- ResourceExpression.cs
- ELinqQueryState.cs
- ProjectionPruner.cs
- ActionMismatchAddressingException.cs
- SerializableAttribute.cs
- FileEnumerator.cs
- Int64Storage.cs
- Condition.cs
- SpecularMaterial.cs
- ComplusEndpointConfigContainer.cs
- LinqDataSourceHelper.cs
- AsymmetricKeyExchangeFormatter.cs
- SpeechRecognizer.cs
- SectionVisual.cs