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
- SystemFonts.cs
- XamlVector3DCollectionSerializer.cs
- ManagedCodeMarkers.cs
- DataGridViewCellStyle.cs
- SmiRequestExecutor.cs
- GroupBoxDesigner.cs
- WinFormsComponentEditor.cs
- FontCacheLogic.cs
- StyleSelector.cs
- DesignOnlyAttribute.cs
- XmlSchemaObject.cs
- PixelShader.cs
- ListViewItem.cs
- XmlSignatureManifest.cs
- AdCreatedEventArgs.cs
- CrossAppDomainChannel.cs
- x509utils.cs
- BStrWrapper.cs
- DataGridViewAdvancedBorderStyle.cs
- InlineUIContainer.cs
- ReturnValue.cs
- HttpStreamMessage.cs
- VisemeEventArgs.cs
- AnimatedTypeHelpers.cs
- OleDbFactory.cs
- CompilerGlobalScopeAttribute.cs
- InvalidCommandTreeException.cs
- columnmapkeybuilder.cs
- UserValidatedEventArgs.cs
- CustomActivityDesigner.cs
- ReachFixedDocumentSerializer.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ToolStripItemTextRenderEventArgs.cs
- DocumentViewerConstants.cs
- GenericParameterDataContract.cs
- BulletedList.cs
- SecurityListenerSettingsLifetimeManager.cs
- BaseInfoTable.cs
- SlipBehavior.cs
- HttpCacheVaryByContentEncodings.cs
- TextModifierScope.cs
- ReflectionUtil.cs
- SelectorItemAutomationPeer.cs
- HMAC.cs
- DefaultValueAttribute.cs
- FileDialog.cs
- SubMenuStyleCollection.cs
- TextRangeEditLists.cs
- EncodingFallbackAwareXmlTextWriter.cs
- CheckPair.cs
- RoleService.cs
- BasicHttpMessageSecurity.cs
- KeyedCollection.cs
- CharacterBuffer.cs
- DrawingVisual.cs
- InvalidPrinterException.cs
- FontSizeConverter.cs
- OleCmdHelper.cs
- SwitchCase.cs
- BasePattern.cs
- ExecutionContext.cs
- MetadataStore.cs
- UIAgentRequest.cs
- WebDisplayNameAttribute.cs
- UpdateCompiler.cs
- Psha1DerivedKeyGenerator.cs
- TraceUtils.cs
- XmlNodeList.cs
- EntityClassGenerator.cs
- CachedFontFamily.cs
- EmissiveMaterial.cs
- ContextMenuService.cs
- CustomPopupPlacement.cs
- TextEditor.cs
- StyleHelper.cs
- RelationshipConverter.cs
- RoleManagerSection.cs
- DSASignatureFormatter.cs
- TargetControlTypeCache.cs
- RawStylusInputCustomDataList.cs
- TemplateComponentConnector.cs
- ActiveXSite.cs
- Utilities.cs
- ActivatedMessageQueue.cs
- ToolStripContentPanel.cs
- PasswordBoxAutomationPeer.cs
- ParenthesizePropertyNameAttribute.cs
- ExpandCollapsePattern.cs
- UnsafeNativeMethods.cs
- DefaultMemberAttribute.cs
- LogicalExpressionEditor.cs
- _Win32.cs
- PrtCap_Base.cs
- EdmType.cs
- WebBrowsableAttribute.cs
- CapabilitiesState.cs
- InternalMappingException.cs
- NullReferenceException.cs
- EventHandlerService.cs
- Floater.cs