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
- SmtpReplyReader.cs
- EntityDataSourceStatementEditor.cs
- XmlValidatingReaderImpl.cs
- WpfKnownTypeInvoker.cs
- UserPreferenceChangingEventArgs.cs
- TextShapeableCharacters.cs
- HealthMonitoringSection.cs
- XmlAnyElementAttributes.cs
- LogicalMethodInfo.cs
- RoleManagerModule.cs
- EventHandlersStore.cs
- ExpressionPrefixAttribute.cs
- TextSelectionHelper.cs
- XMLUtil.cs
- XmlCompatibilityReader.cs
- InputEventArgs.cs
- CornerRadiusConverter.cs
- ObjectListItem.cs
- ProtocolsConfiguration.cs
- Int32AnimationBase.cs
- LinkUtilities.cs
- ComponentGuaranteesAttribute.cs
- QuaternionRotation3D.cs
- PropertyItem.cs
- SamlAction.cs
- CollectionDataContractAttribute.cs
- FunctionImportMapping.cs
- Triangle.cs
- ProviderException.cs
- SoapParser.cs
- HtmlControl.cs
- BaseTemplatedMobileComponentEditor.cs
- BorderGapMaskConverter.cs
- BitmapEffectState.cs
- CustomAttribute.cs
- Panel.cs
- AppAction.cs
- BitmapEffectGroup.cs
- SmiEventSink.cs
- DataRow.cs
- StreamReader.cs
- RequiredFieldValidator.cs
- PrimitiveXmlSerializers.cs
- SafeNativeMethods.cs
- PageAdapter.cs
- XPathNavigatorKeyComparer.cs
- ScriptingWebServicesSectionGroup.cs
- ConnectionPoint.cs
- TrackingLocation.cs
- X509SecurityToken.cs
- StylusCollection.cs
- BamlTreeMap.cs
- _SslState.cs
- X509CertificateCollection.cs
- ContainerUIElement3D.cs
- StrokeNodeOperations.cs
- GenericWebPart.cs
- WSFederationHttpSecurityMode.cs
- GridViewEditEventArgs.cs
- SecurityTokenSpecification.cs
- UserControlParser.cs
- XmlSchemaSimpleContent.cs
- MDIControlStrip.cs
- ItemsPresenter.cs
- WebPartExportVerb.cs
- MeshGeometry3D.cs
- SelectionProviderWrapper.cs
- AssociationType.cs
- TextEditorCharacters.cs
- TagPrefixInfo.cs
- CopyCodeAction.cs
- ServicesUtilities.cs
- OleDbError.cs
- X509CertificateEndpointIdentity.cs
- CatalogZoneDesigner.cs
- TextFormatterHost.cs
- LinqDataSourceInsertEventArgs.cs
- ToggleProviderWrapper.cs
- ProviderSettings.cs
- LinkClickEvent.cs
- IPCCacheManager.cs
- BuildProviderUtils.cs
- TreeBuilder.cs
- ModelItemKeyValuePair.cs
- OptimalTextSource.cs
- FileDataSourceCache.cs
- XmlSerializerSection.cs
- SingleStorage.cs
- HyperlinkAutomationPeer.cs
- CmsInterop.cs
- DrawTreeNodeEventArgs.cs
- WebBodyFormatMessageProperty.cs
- XamlVector3DCollectionSerializer.cs
- StyleBamlTreeBuilder.cs
- MailDefinition.cs
- PropertyValueChangedEvent.cs
- ParameterElement.cs
- ToolStripControlHost.cs
- ToolBarOverflowPanel.cs
- PropagatorResult.cs