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
- KnownTypeAttribute.cs
- MessagePropertyDescriptionCollection.cs
- PropertyPathWorker.cs
- GeneralTransform.cs
- PackageRelationshipCollection.cs
- ConnectionManagementSection.cs
- ProxyAttribute.cs
- ThicknessAnimationUsingKeyFrames.cs
- LinqDataSourceValidationException.cs
- DataGridColumnCollection.cs
- RegexBoyerMoore.cs
- WebServicesInteroperability.cs
- UserControlDocumentDesigner.cs
- SafeFindHandle.cs
- NTAccount.cs
- Pair.cs
- DataList.cs
- WorkflowRequestContext.cs
- WebPartAddingEventArgs.cs
- PropertyNames.cs
- SocketInformation.cs
- DataGridColumnCollection.cs
- input.cs
- SqlComparer.cs
- WindowsFormsHostPropertyMap.cs
- CollectionChange.cs
- EntityDesignerUtils.cs
- Baml2006ReaderContext.cs
- assemblycache.cs
- AtomEntry.cs
- StrokeDescriptor.cs
- ElementProxy.cs
- BinaryFormatter.cs
- PerformanceCounterManager.cs
- Transactions.cs
- PartEditor.cs
- GradientSpreadMethodValidation.cs
- TrustLevel.cs
- contentDescriptor.cs
- SchemaManager.cs
- SmtpMail.cs
- ContentPlaceHolder.cs
- RoutingSection.cs
- CharUnicodeInfo.cs
- ServerValidateEventArgs.cs
- RawStylusInputCustomData.cs
- SrgsToken.cs
- AuthenticodeSignatureInformation.cs
- PackageDigitalSignatureManager.cs
- DateTimeParse.cs
- EventWaitHandleSecurity.cs
- CodeNamespace.cs
- ComponentCommands.cs
- GlyphRunDrawing.cs
- InputBindingCollection.cs
- XdrBuilder.cs
- BatchWriter.cs
- MemberBinding.cs
- ToolStripPanel.cs
- TextTreeTextElementNode.cs
- ApplicationInfo.cs
- ChannelOptions.cs
- ComponentManagerBroker.cs
- SqlFormatter.cs
- CodeIndexerExpression.cs
- Metafile.cs
- TextRunProperties.cs
- PreservationFileReader.cs
- ReflectPropertyDescriptor.cs
- DataObjectCopyingEventArgs.cs
- _AutoWebProxyScriptHelper.cs
- ResourceContainer.cs
- ArrangedElement.cs
- EventRouteFactory.cs
- WindowsAltTab.cs
- ProgressBarBrushConverter.cs
- FormViewDeletedEventArgs.cs
- WebEventTraceProvider.cs
- Int32RectConverter.cs
- DiagnosticTraceSource.cs
- SmtpNegotiateAuthenticationModule.cs
- ResourcesChangeInfo.cs
- XmlSubtreeReader.cs
- ClockGroup.cs
- connectionpool.cs
- Graphics.cs
- ConfigXmlText.cs
- DbgUtil.cs
- HtmlControl.cs
- DataGridViewComboBoxColumn.cs
- XmlArrayItemAttributes.cs
- XmlName.cs
- EntityDataSource.cs
- XmlNotation.cs
- FixedPage.cs
- cache.cs
- GetPageCompletedEventArgs.cs
- RequestCache.cs
- wmiprovider.cs
- SemanticResultKey.cs