Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathAxisIterator.cs / 1 / XPathAxisIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; using System.Globalization; internal abstract class XPathAxisIterator: XPathNodeIterator { internal XPathNavigator nav; internal XPathNodeType type; internal string name; internal string uri; internal int position; internal bool matchSelf; internal bool first = true; public XPathAxisIterator(XPathNavigator nav, bool matchSelf) { this.nav = nav; this.matchSelf = matchSelf; } public XPathAxisIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : this(nav, matchSelf) { this.type = type; } public XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : this(nav, matchSelf) { if (name == null) throw new ArgumentNullException("name"); if (namespaceURI == null) throw new ArgumentNullException("namespaceURI"); this.name = name; this.uri = namespaceURI; } public XPathAxisIterator(XPathAxisIterator it) { this.nav = it.nav.Clone(); this.type = it.type; this.name = it.name; this.uri = it.uri; this.position = it.position; this.matchSelf = it.matchSelf; this.first = it.first; } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } // Nodetype Matching - Given nodetype matches the navigator's nodetype //Given nodetype is all . So it matches everything //Given nodetype is text - Matches text, WS, Significant WS protected virtual bool Matches { get { if (name == null) { return ( type == nav.NodeType || type == XPathNodeType.All || type == XPathNodeType.Text && ( nav.NodeType == XPathNodeType.Whitespace || nav.NodeType == XPathNodeType.SignificantWhitespace ) ); } else { return( nav.NodeType == XPathNodeType.Element && (name.Length == 0 || name == nav.LocalName) && (uri == nav.NamespaceURI) ); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; using System.Globalization; internal abstract class XPathAxisIterator: XPathNodeIterator { internal XPathNavigator nav; internal XPathNodeType type; internal string name; internal string uri; internal int position; internal bool matchSelf; internal bool first = true; public XPathAxisIterator(XPathNavigator nav, bool matchSelf) { this.nav = nav; this.matchSelf = matchSelf; } public XPathAxisIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : this(nav, matchSelf) { this.type = type; } public XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : this(nav, matchSelf) { if (name == null) throw new ArgumentNullException("name"); if (namespaceURI == null) throw new ArgumentNullException("namespaceURI"); this.name = name; this.uri = namespaceURI; } public XPathAxisIterator(XPathAxisIterator it) { this.nav = it.nav.Clone(); this.type = it.type; this.name = it.name; this.uri = it.uri; this.position = it.position; this.matchSelf = it.matchSelf; this.first = it.first; } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } // Nodetype Matching - Given nodetype matches the navigator's nodetype //Given nodetype is all . So it matches everything //Given nodetype is text - Matches text, WS, Significant WS protected virtual bool Matches { get { if (name == null) { return ( type == nav.NodeType || type == XPathNodeType.All || type == XPathNodeType.Text && ( nav.NodeType == XPathNodeType.Whitespace || nav.NodeType == XPathNodeType.SignificantWhitespace ) ); } else { return( nav.NodeType == XPathNodeType.Element && (name.Length == 0 || name == nav.LocalName) && (uri == nav.NamespaceURI) ); } } } } } // 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
- CoreChannel.cs
- HideDisabledControlAdapter.cs
- Int16Animation.cs
- DbgCompiler.cs
- XsdBuildProvider.cs
- PlatformNotSupportedException.cs
- ArraySubsetEnumerator.cs
- DetailsViewUpdateEventArgs.cs
- XmlAttributeHolder.cs
- HwndSubclass.cs
- InkSerializer.cs
- RowToParametersTransformer.cs
- DesignerActionList.cs
- URI.cs
- ListViewHitTestInfo.cs
- LogicalChannelCollection.cs
- MasterPage.cs
- Line.cs
- DataServiceQuery.cs
- _NegoState.cs
- CollectionChange.cs
- SqlInfoMessageEvent.cs
- ProjectionCamera.cs
- DBCSCodePageEncoding.cs
- Int32CollectionConverter.cs
- Vector3DConverter.cs
- ClientApiGenerator.cs
- PanelStyle.cs
- MergePropertyDescriptor.cs
- RuntimeIdentifierPropertyAttribute.cs
- NamespaceCollection.cs
- PixelFormat.cs
- ObfuscateAssemblyAttribute.cs
- EventLogWatcher.cs
- ContentWrapperAttribute.cs
- TextBox.cs
- SID.cs
- EncryptedKeyHashIdentifierClause.cs
- UniqueEventHelper.cs
- ConstantCheck.cs
- SymbolType.cs
- wgx_commands.cs
- AttachedProperty.cs
- TextOutput.cs
- AuthorizationContext.cs
- EncryptedKey.cs
- AnnouncementEndpointElement.cs
- CopyOfAction.cs
- AsnEncodedData.cs
- TextFindEngine.cs
- FileDialogCustomPlacesCollection.cs
- PartialList.cs
- CellIdBoolean.cs
- ColorAnimationBase.cs
- BaseConfigurationRecord.cs
- CharKeyFrameCollection.cs
- HttpModuleCollection.cs
- XmlSerializationReader.cs
- ProtectedConfiguration.cs
- xmlglyphRunInfo.cs
- PropertyEntry.cs
- CellParagraph.cs
- ParallelForEach.cs
- JavaScriptSerializer.cs
- EmptyReadOnlyDictionaryInternal.cs
- SetState.cs
- ErrorFormatter.cs
- CodeAttributeArgument.cs
- FontSource.cs
- TrustManagerMoreInformation.cs
- IndexedWhereQueryOperator.cs
- RegexParser.cs
- ProxyManager.cs
- WebPartEditorCancelVerb.cs
- SafeThreadHandle.cs
- LineGeometry.cs
- NaturalLanguageHyphenator.cs
- PowerStatus.cs
- base64Transforms.cs
- BevelBitmapEffect.cs
- PrinterSettings.cs
- StrokeCollectionConverter.cs
- VerificationAttribute.cs
- DefaultValueAttribute.cs
- FilteredSchemaElementLookUpTable.cs
- DataServiceKeyAttribute.cs
- NameValueCache.cs
- EntityDataSourceConfigureObjectContext.cs
- SpeechUI.cs
- PropertyEntry.cs
- OrCondition.cs
- XmlSchemaSimpleTypeUnion.cs
- EventHandlerList.cs
- MemberAccessException.cs
- TreeBuilderXamlTranslator.cs
- RangeValuePattern.cs
- InvokeProviderWrapper.cs
- SystemFonts.cs
- WinOEToolBoxItem.cs
- DbDataAdapter.cs