Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlNavigatorStack.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- IteratorFilter.cs
- DiscoveryVersionConverter.cs
- ArgIterator.cs
- TextRangeAdaptor.cs
- TextEditorDragDrop.cs
- SevenBitStream.cs
- DetailsViewDeletedEventArgs.cs
- InputLanguageSource.cs
- SaveCardRequest.cs
- SafeFileHandle.cs
- InputReferenceExpression.cs
- Util.cs
- AmbientLight.cs
- ImageListStreamer.cs
- StateFinalizationActivity.cs
- LoginDesigner.cs
- DbParameterCollectionHelper.cs
- ColorMap.cs
- Action.cs
- TraceLog.cs
- linebase.cs
- ItemsControlAutomationPeer.cs
- ScrollEventArgs.cs
- GiveFeedbackEventArgs.cs
- TranslateTransform3D.cs
- AsyncResult.cs
- Setter.cs
- XmlBinaryReader.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ParameterBuilder.cs
- WebResourceUtil.cs
- COM2ExtendedTypeConverter.cs
- DataListItemCollection.cs
- DesignerTransaction.cs
- ErrorRuntimeConfig.cs
- EntityContainer.cs
- NotifyParentPropertyAttribute.cs
- CompModHelpers.cs
- DemultiplexingClientMessageFormatter.cs
- ValueChangedEventManager.cs
- LocalizationCodeDomSerializer.cs
- CompleteWizardStep.cs
- ServiceRouteHandler.cs
- Scheduling.cs
- SqlCacheDependencyDatabase.cs
- ReplyChannel.cs
- WebBrowser.cs
- CookieProtection.cs
- UnsafeNativeMethods.cs
- FeatureSupport.cs
- BasicViewGenerator.cs
- ProfilePropertyNameValidator.cs
- AtomContentProperty.cs
- PrinterUnitConvert.cs
- UnionExpr.cs
- Matrix.cs
- iisPickupDirectory.cs
- WrapPanel.cs
- DataTransferEventArgs.cs
- StickyNoteHelper.cs
- ListControlStringCollectionEditor.cs
- NodeLabelEditEvent.cs
- StackBuilderSink.cs
- SafeLocalMemHandle.cs
- EntityProviderServices.cs
- NameValueSectionHandler.cs
- SpecialFolderEnumConverter.cs
- ExceptionHandlersDesigner.cs
- CapabilitiesAssignment.cs
- DataGridViewButtonColumn.cs
- TypedLocationWrapper.cs
- SafeHGlobalHandleCritical.cs
- AttributeData.cs
- HelpInfo.cs
- Documentation.cs
- TCEAdapterGenerator.cs
- HttpRuntimeSection.cs
- SqlDataSourceView.cs
- ConfigLoader.cs
- HuffCodec.cs
- As.cs
- ApplicationTrust.cs
- DataBoundControl.cs
- ServiceNameElementCollection.cs
- GeometryModel3D.cs
- ReflectPropertyDescriptor.cs
- SecurityTraceRecordHelper.cs
- Point3DKeyFrameCollection.cs
- MetaForeignKeyColumn.cs
- PackUriHelper.cs
- DoubleLinkList.cs
- D3DImage.cs
- ContentValidator.cs
- X509PeerCertificateElement.cs
- RijndaelManaged.cs
- RegexWorker.cs
- StringFunctions.cs
- WinEventQueueItem.cs
- Control.cs
- RawStylusInputReport.cs