Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlNavigatorStack.cs / 1305376 / XmlNavigatorStack.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; namespace System.Xml.Xsl.Runtime { ////// A dynamic stack of IXmlNavigators. /// internal struct XmlNavigatorStack { private XPathNavigator[] stkNav; // Stack of XPathNavigators private int sp; // Stack pointer (size of stack) #if DEBUG private const int InitialStackSize = 2; #else private const int InitialStackSize = 8; #endif ////// Push a navigator onto the stack /// public void Push(XPathNavigator nav) { if (this.stkNav == null) { this.stkNav = new XPathNavigator[InitialStackSize]; } else { if (this.sp >= this.stkNav.Length) { // Resize the stack XPathNavigator[] stkOld = this.stkNav; this.stkNav = new XPathNavigator[2 * this.sp]; Array.Copy(stkOld, this.stkNav, this.sp); } } this.stkNav[this.sp++] = nav; } ////// Pop the topmost navigator and return it /// public XPathNavigator Pop() { Debug.Assert(!IsEmpty); return this.stkNav[--this.sp]; } ////// Returns the navigator at the top of the stack without adjusting the stack pointer /// public XPathNavigator Peek() { Debug.Assert(!IsEmpty); return this.stkNav[this.sp - 1]; } ////// Remove all navigators from the stack /// public void Reset() { this.sp = 0; } ////// Returns true if there are no navigators in the stack /// public bool IsEmpty { get { return this.sp == 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
- IIS7UserPrincipal.cs
- UriScheme.cs
- HostingEnvironmentSection.cs
- NodeFunctions.cs
- Crc32.cs
- Literal.cs
- WmpBitmapEncoder.cs
- WebPartsPersonalizationAuthorization.cs
- ModuleElement.cs
- GradientStop.cs
- WorkflowTerminatedException.cs
- LightweightCodeGenerator.cs
- XmlSchemaObject.cs
- WindowsScrollBarBits.cs
- EntityDataSourceState.cs
- AnimationClock.cs
- Stack.cs
- DateTime.cs
- CompilerResults.cs
- DesignerVerb.cs
- IODescriptionAttribute.cs
- TabControl.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- JsonQNameDataContract.cs
- PrintControllerWithStatusDialog.cs
- PackWebRequest.cs
- TypeSystem.cs
- XmlWrappingWriter.cs
- SafeIUnknown.cs
- securitycriticaldataClass.cs
- XamlTreeBuilderBamlRecordWriter.cs
- AbsoluteQuery.cs
- QuaternionIndependentAnimationStorage.cs
- Model3D.cs
- SchemaElementDecl.cs
- ArraySegment.cs
- SpellCheck.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- PeerCollaboration.cs
- InitialServerConnectionReader.cs
- DateTimeSerializationSection.cs
- NotifyInputEventArgs.cs
- grammarelement.cs
- RegisteredExpandoAttribute.cs
- ViewCellSlot.cs
- Label.cs
- Tool.cs
- ServiceModelSecurityTokenRequirement.cs
- Win32.cs
- AddInToken.cs
- HttpApplication.cs
- ExpressionVisitorHelpers.cs
- SerializerDescriptor.cs
- XmlTextReaderImpl.cs
- WindowInteractionStateTracker.cs
- SqlAliasesReferenced.cs
- MemberAccessException.cs
- SingleResultAttribute.cs
- ClientProtocol.cs
- CustomValidator.cs
- LineGeometry.cs
- sqlstateclientmanager.cs
- DataServicePagingProviderWrapper.cs
- ListDataHelper.cs
- HttpCookie.cs
- TransformedBitmap.cs
- ZipIOBlockManager.cs
- OdbcConnectionString.cs
- VirtualDirectoryMapping.cs
- TypeReference.cs
- IDQuery.cs
- Line.cs
- ChangePassword.cs
- EncodingDataItem.cs
- CodeArgumentReferenceExpression.cs
- ObjectReaderCompiler.cs
- ResourceBinder.cs
- NominalTypeEliminator.cs
- DispatcherProcessingDisabled.cs
- DataGridItem.cs
- StaticResourceExtension.cs
- MiniParameterInfo.cs
- RemotingHelper.cs
- XmlSchemaDatatype.cs
- ArraySortHelper.cs
- DropAnimation.xaml.cs
- DynamicPropertyHolder.cs
- DynamicPropertyReader.cs
- IQueryable.cs
- SoundPlayer.cs
- SudsParser.cs
- XmlConvert.cs
- ConfigXmlWhitespace.cs
- Point.cs
- MenuEventArgs.cs
- ManualResetEvent.cs
- StatusBarItem.cs
- JavaScriptString.cs
- StylusPointPropertyUnit.cs
- DelegatingTypeDescriptionProvider.cs