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
- WebServiceData.cs
- DataGridBeginningEditEventArgs.cs
- Int16.cs
- ContractMapping.cs
- returneventsaver.cs
- _StreamFramer.cs
- PropertyValueChangedEvent.cs
- XamlPathDataSerializer.cs
- LoaderAllocator.cs
- WebPartManagerInternals.cs
- SafeNativeMethodsOther.cs
- SystemInfo.cs
- AppDomainUnloadedException.cs
- MissingManifestResourceException.cs
- InfoCardAsymmetricCrypto.cs
- TextRangeEditLists.cs
- CompilationRelaxations.cs
- IgnoreFileBuildProvider.cs
- ExpressionBuilderContext.cs
- RelationshipType.cs
- NeutralResourcesLanguageAttribute.cs
- WebPartManager.cs
- DocumentManager.cs
- ZipIOLocalFileDataDescriptor.cs
- PerfCounters.cs
- CodeDirectoryCompiler.cs
- Geometry3D.cs
- ConfigLoader.cs
- SqlUnionizer.cs
- TdsParserSessionPool.cs
- SqlUdtInfo.cs
- AlternateView.cs
- TypeUsage.cs
- TextRangeBase.cs
- TypedReference.cs
- SizeLimitedCache.cs
- VarRemapper.cs
- WinCategoryAttribute.cs
- MetadataArtifactLoaderCompositeFile.cs
- SelectionWordBreaker.cs
- TimeEnumHelper.cs
- MetadataArtifactLoaderFile.cs
- WebPartEventArgs.cs
- COMException.cs
- EventDescriptor.cs
- ToolStripPanelRenderEventArgs.cs
- XmlValidatingReaderImpl.cs
- SerializableReadOnlyDictionary.cs
- FlowLayoutPanel.cs
- MsmqUri.cs
- SymLanguageVendor.cs
- RowParagraph.cs
- CodeNamespaceImport.cs
- Transaction.cs
- ICspAsymmetricAlgorithm.cs
- LinqToSqlWrapper.cs
- ViewStateModeByIdAttribute.cs
- OracleFactory.cs
- DSASignatureDeformatter.cs
- CodeSnippetExpression.cs
- MultiViewDesigner.cs
- WmlLiteralTextAdapter.cs
- HostExecutionContextManager.cs
- RectValueSerializer.cs
- TextSelectionHelper.cs
- ToolStripPanelSelectionGlyph.cs
- HtmlShim.cs
- StreamHelper.cs
- HitTestDrawingContextWalker.cs
- TextLineResult.cs
- ApplyTemplatesAction.cs
- TableLayoutRowStyleCollection.cs
- XmlArrayAttribute.cs
- DocumentPageTextView.cs
- Certificate.cs
- KoreanCalendar.cs
- CombinedTcpChannel.cs
- BypassElementCollection.cs
- BinaryFormatter.cs
- SizeAnimationBase.cs
- ContentHostHelper.cs
- WebBrowserUriTypeConverter.cs
- cookieexception.cs
- RecognitionResult.cs
- AccessKeyManager.cs
- WsatServiceCertificate.cs
- OleDbParameter.cs
- HyperLinkStyle.cs
- BackgroundWorker.cs
- BoolExpressionVisitors.cs
- Math.cs
- MultiTouchSystemGestureLogic.cs
- HiddenFieldPageStatePersister.cs
- controlskin.cs
- LinqDataSourceValidationException.cs
- ExpandSegment.cs
- ClientScriptItemCollection.cs
- EntityDataSourceContextCreatedEventArgs.cs
- DirectionalLight.cs
- PointAnimationClockResource.cs