Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / IteratorFilter.cs / 1305376 / IteratorFilter.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 class IteratorFilter : XPathNodeIterator { private XPathNodeIterator innerIterator; private string name; private int position = 0; internal IteratorFilter(XPathNodeIterator innerIterator, string name) { this.innerIterator = innerIterator; this.name = name; } private IteratorFilter(IteratorFilter it) { this.innerIterator = it.innerIterator.Clone(); this.name = it.name; this.position = it.position; } public override XPathNodeIterator Clone() { return new IteratorFilter(this); } public override XPathNavigator Current { get { return innerIterator.Current;} } public override int CurrentPosition { get { return this.position; } } public override bool MoveNext() { while(innerIterator.MoveNext()) { if(innerIterator.Current.LocalName == this.name) { this.position ++; return true; } } return false; } } } // 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 class IteratorFilter : XPathNodeIterator { private XPathNodeIterator innerIterator; private string name; private int position = 0; internal IteratorFilter(XPathNodeIterator innerIterator, string name) { this.innerIterator = innerIterator; this.name = name; } private IteratorFilter(IteratorFilter it) { this.innerIterator = it.innerIterator.Clone(); this.name = it.name; this.position = it.position; } public override XPathNodeIterator Clone() { return new IteratorFilter(this); } public override XPathNavigator Current { get { return innerIterator.Current;} } public override int CurrentPosition { get { return this.position; } } public override bool MoveNext() { while(innerIterator.MoveNext()) { if(innerIterator.Current.LocalName == this.name) { this.position ++; return true; } } return false; } } } // 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
- CheckBoxFlatAdapter.cs
- HttpConfigurationContext.cs
- ListenerElementsCollection.cs
- SourceChangedEventArgs.cs
- JavaScriptSerializer.cs
- StyleTypedPropertyAttribute.cs
- CollectionBuilder.cs
- OpenTypeCommon.cs
- DataBindingList.cs
- X509AsymmetricSecurityKey.cs
- HttpPostedFileWrapper.cs
- XamlToRtfWriter.cs
- TextBoxAutomationPeer.cs
- CheckBoxList.cs
- DataMember.cs
- DbConnectionPoolGroup.cs
- _NetworkingPerfCounters.cs
- ArrayHelper.cs
- X509AudioLogo.cs
- EnumConverter.cs
- ObjectDisposedException.cs
- CalendarDesigner.cs
- SystemDropShadowChrome.cs
- ReachSerializer.cs
- ItemsControlAutomationPeer.cs
- WindowsProgressbar.cs
- ProxyHelper.cs
- MemberRelationshipService.cs
- BindingList.cs
- XsltCompileContext.cs
- Axis.cs
- List.cs
- PrimitiveSchema.cs
- ScriptingRoleServiceSection.cs
- PageParserFilter.cs
- AsymmetricKeyExchangeFormatter.cs
- Schema.cs
- TimeManager.cs
- MyContact.cs
- Site.cs
- HeaderedContentControl.cs
- SqlProviderServices.cs
- SingleAnimation.cs
- RequestCachePolicyConverter.cs
- DataGridViewRowsRemovedEventArgs.cs
- RegexRunnerFactory.cs
- PromptBuilder.cs
- CodeAssignStatement.cs
- DoWhile.cs
- securitycriticaldata.cs
- UnsafeNativeMethods.cs
- EnumerableRowCollection.cs
- DataGridSortCommandEventArgs.cs
- SoapIncludeAttribute.cs
- Membership.cs
- RefType.cs
- Hash.cs
- Number.cs
- QueryContinueDragEvent.cs
- TextBoxLine.cs
- ProjectionCamera.cs
- DesignerObject.cs
- Single.cs
- Events.cs
- DesignColumn.cs
- TimeSpanStorage.cs
- DesignBindingPropertyDescriptor.cs
- XamlSerializerUtil.cs
- ZipFileInfo.cs
- FactoryGenerator.cs
- SafePipeHandle.cs
- ImageKeyConverter.cs
- TextElement.cs
- XmlSchemaNotation.cs
- PatternMatchRules.cs
- UnitySerializationHolder.cs
- AuthenticationServiceManager.cs
- AsyncStreamReader.cs
- PropertyValueUIItem.cs
- StringDictionary.cs
- IntegerValidator.cs
- SBCSCodePageEncoding.cs
- ListBoxAutomationPeer.cs
- ColorContextHelper.cs
- MetafileHeaderEmf.cs
- WinEventWrap.cs
- VarRemapper.cs
- BuildTopDownAttribute.cs
- ResourcesBuildProvider.cs
- indexingfiltermarshaler.cs
- XmlDocumentSchema.cs
- FormViewInsertEventArgs.cs
- XmlNodeReader.cs
- HttpPostClientProtocol.cs
- ObjectKeyFrameCollection.cs
- DoWorkEventArgs.cs
- DataListItemEventArgs.cs
- NameNode.cs
- LinqTreeNodeEvaluator.cs
- FederatedMessageSecurityOverHttp.cs