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
- ViewKeyConstraint.cs
- XMLUtil.cs
- DbgUtil.cs
- GlobalProxySelection.cs
- XmlWhitespace.cs
- SHA1.cs
- XPathNodeList.cs
- LoadMessageLogger.cs
- DesignerVerb.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- SessionMode.cs
- SmtpDigestAuthenticationModule.cs
- ParsedAttributeCollection.cs
- ActivityCodeDomSerializationManager.cs
- ResolvedKeyFrameEntry.cs
- ProfileSection.cs
- XamlClipboardData.cs
- Thickness.cs
- SelectionChangedEventArgs.cs
- SystemIPInterfaceProperties.cs
- OperatingSystem.cs
- TraceEventCache.cs
- IdentifierCreationService.cs
- ManifestBasedResourceGroveler.cs
- RemotingSurrogateSelector.cs
- JsonDataContract.cs
- TableLayoutColumnStyleCollection.cs
- RepeaterItem.cs
- Membership.cs
- ToolStripMenuItem.cs
- CounterSetInstance.cs
- MsmqInputSessionChannelListener.cs
- SByteStorage.cs
- ReadOnlyDictionary.cs
- FullTextState.cs
- AuthenticationService.cs
- ToolboxItemImageConverter.cs
- ClientProxyGenerator.cs
- Int32RectConverter.cs
- PreloadHost.cs
- EdmFunctionAttribute.cs
- ResourceDefaultValueAttribute.cs
- QuaternionConverter.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ErrorWebPart.cs
- Stroke2.cs
- LinkClickEvent.cs
- InProcStateClientManager.cs
- CompositeFontFamily.cs
- XpsImage.cs
- SafeRightsManagementPubHandle.cs
- MaskedTextProvider.cs
- TableCellCollection.cs
- SecuritySessionSecurityTokenProvider.cs
- IntegerValidatorAttribute.cs
- ParameterCollection.cs
- InheritanceContextHelper.cs
- CheckBox.cs
- RawStylusInputCustomData.cs
- XmlNode.cs
- Config.cs
- Stylesheet.cs
- ManifestSignatureInformation.cs
- ImageListStreamer.cs
- BitConverter.cs
- UrlUtility.cs
- SqlClientWrapperSmiStream.cs
- NameValueConfigurationElement.cs
- ParallelRangeManager.cs
- Tile.cs
- CorrelationManager.cs
- WpfWebRequestHelper.cs
- XamlUtilities.cs
- ReadOnlyAttribute.cs
- XamlDesignerSerializationManager.cs
- EntityWrapperFactory.cs
- BamlReader.cs
- XmlStringTable.cs
- GridViewDesigner.cs
- ConstraintConverter.cs
- KeyedHashAlgorithm.cs
- DashStyle.cs
- KeyValueSerializer.cs
- CustomValidator.cs
- ArrayList.cs
- RangeValuePatternIdentifiers.cs
- WindowsUpDown.cs
- SetterBaseCollection.cs
- SelectionPatternIdentifiers.cs
- MessageFormatterConverter.cs
- RangeContentEnumerator.cs
- XmlAnyElementAttributes.cs
- NotificationContext.cs
- NetMsmqBinding.cs
- ExternalFile.cs
- SmtpReplyReaderFactory.cs
- JoinCqlBlock.cs
- Vector3DAnimation.cs
- CustomValidator.cs
- XmlSchemaSet.cs