Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathSingletonIterator.cs / 1 / XPathSingletonIterator.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 XPathSingletonIterator: ResetableIterator { private XPathNavigator nav; private int position; public XPathSingletonIterator(XPathNavigator nav) { Debug.Assert(nav != null); this.nav = nav; } public XPathSingletonIterator(XPathNavigator nav, bool moved) : this(nav) { if (moved) { position = 1; } } public XPathSingletonIterator(XPathSingletonIterator it) { this.nav = it.nav.Clone(); this.position = it.position; } public override XPathNodeIterator Clone() { return new XPathSingletonIterator(this); } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } public override int Count { get { return 1; } } public override bool MoveNext() { if(position == 0) { position = 1; return true; } return false; } public override void Reset() { position = 0; } } } // 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 XPathSingletonIterator: ResetableIterator { private XPathNavigator nav; private int position; public XPathSingletonIterator(XPathNavigator nav) { Debug.Assert(nav != null); this.nav = nav; } public XPathSingletonIterator(XPathNavigator nav, bool moved) : this(nav) { if (moved) { position = 1; } } public XPathSingletonIterator(XPathSingletonIterator it) { this.nav = it.nav.Clone(); this.position = it.position; } public override XPathNodeIterator Clone() { return new XPathSingletonIterator(this); } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } public override int Count { get { return 1; } } public override bool MoveNext() { if(position == 0) { position = 1; return true; } return false; } public override void Reset() { position = 0; } } } // 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
- BoundPropertyEntry.cs
- SiteMapNodeItem.cs
- InvariantComparer.cs
- ScopelessEnumAttribute.cs
- FrameworkElementFactoryMarkupObject.cs
- SimpleHandlerBuildProvider.cs
- XslAst.cs
- DesignOnlyAttribute.cs
- AnonymousIdentificationSection.cs
- DataControlFieldsEditor.cs
- HelpEvent.cs
- PropertyEmitter.cs
- ServiceDurableInstance.cs
- BitmapMetadata.cs
- XmlBoundElement.cs
- XmlWhitespace.cs
- DesignerAttribute.cs
- ChangePassword.cs
- CharUnicodeInfo.cs
- CodeTypeMemberCollection.cs
- FormatSettings.cs
- MemberRelationshipService.cs
- XmlSchemaAny.cs
- CodeDomDecompiler.cs
- WebPartConnectionsCancelVerb.cs
- MenuBase.cs
- MarshalByValueComponent.cs
- OraclePermissionAttribute.cs
- MarginsConverter.cs
- SecurityRuntime.cs
- DesignerAutoFormatStyle.cs
- LineServices.cs
- SmtpNegotiateAuthenticationModule.cs
- MessageQueueCriteria.cs
- WebPartConnectionsConnectVerb.cs
- PassportAuthentication.cs
- RegexInterpreter.cs
- MissingSatelliteAssemblyException.cs
- XmlTypeAttribute.cs
- Dynamic.cs
- WorkflowMarkupSerializerMapping.cs
- XmlDeclaration.cs
- PrintDocument.cs
- DesignTimeHTMLTextWriter.cs
- FlowLayoutSettings.cs
- ProfileGroupSettingsCollection.cs
- SqlReferenceCollection.cs
- ImageCodecInfoPrivate.cs
- DataGridViewMethods.cs
- DescendantBaseQuery.cs
- SessionState.cs
- URLString.cs
- AuthenticationException.cs
- CodeCompiler.cs
- LongTypeConverter.cs
- MSAAEventDispatcher.cs
- DataException.cs
- SpellerHighlightLayer.cs
- InheritanceUI.cs
- Int32Storage.cs
- CustomDictionarySources.cs
- SplashScreen.cs
- SafeNativeMethods.cs
- TextElementEnumerator.cs
- SyndicationElementExtension.cs
- BevelBitmapEffect.cs
- EntityRecordInfo.cs
- SQLInt32.cs
- FormView.cs
- EpmSyndicationContentDeSerializer.cs
- WindowsNonControl.cs
- WindowsComboBox.cs
- MyContact.cs
- IISUnsafeMethods.cs
- RenderContext.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- RtfFormatStack.cs
- DescendantQuery.cs
- FixedSOMSemanticBox.cs
- AmbientLight.cs
- XamlSerializerUtil.cs
- XmlMemberMapping.cs
- UniqueIdentifierService.cs
- EntityDataReader.cs
- CodeDOMProvider.cs
- InputElement.cs
- SoapEnumAttribute.cs
- GlyphRunDrawing.cs
- ErrorFormatter.cs
- DbConnectionFactory.cs
- CheckBox.cs
- MultiBindingExpression.cs
- GroupBoxRenderer.cs
- ProcessModelInfo.cs
- DBConnection.cs
- HyperLinkStyle.cs
- SqlDataSourceFilteringEventArgs.cs
- MailMessageEventArgs.cs
- DbSourceCommand.cs
- _IPv6Address.cs