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
- cache.cs
- ApplicationServiceHelper.cs
- EnumMemberAttribute.cs
- URLString.cs
- ValidatorCollection.cs
- ToolBarButtonClickEvent.cs
- InfoCardSymmetricCrypto.cs
- OuterGlowBitmapEffect.cs
- ResXBuildProvider.cs
- RC2CryptoServiceProvider.cs
- XmlSchemaExternal.cs
- PrintDialog.cs
- TickBar.cs
- LineUtil.cs
- CodeVariableReferenceExpression.cs
- SettingsPropertyIsReadOnlyException.cs
- ChtmlPageAdapter.cs
- DataTemplate.cs
- RangeValuePattern.cs
- SizeKeyFrameCollection.cs
- MsmqChannelListenerBase.cs
- ChangeBlockUndoRecord.cs
- ApplicationManager.cs
- DetailsViewModeEventArgs.cs
- SubtreeProcessor.cs
- MarshalDirectiveException.cs
- CodeConstructor.cs
- DataPagerCommandEventArgs.cs
- TemplateBindingExtensionConverter.cs
- FontCacheUtil.cs
- DrawingContextDrawingContextWalker.cs
- OutputCache.cs
- HighlightComponent.cs
- OleDbMetaDataFactory.cs
- Soap.cs
- ServiceEndpointElementCollection.cs
- DataGridColumn.cs
- CatalogZone.cs
- GridViewActionList.cs
- PermissionSet.cs
- ListViewItemEventArgs.cs
- CompilationUtil.cs
- XmlDigitalSignatureProcessor.cs
- RemoteCryptoRsaServiceProvider.cs
- QualifiedCellIdBoolean.cs
- VisualStyleTypesAndProperties.cs
- WindowsListViewGroupSubsetLink.cs
- XmlNamespaceMappingCollection.cs
- CodeComment.cs
- MouseEventArgs.cs
- BaseConfigurationRecord.cs
- ImplicitInputBrush.cs
- XamlPathDataSerializer.cs
- ReverseInheritProperty.cs
- newinstructionaction.cs
- ToolStripGrip.cs
- SecurityPermission.cs
- FieldReference.cs
- FormViewRow.cs
- ReadOnlyNameValueCollection.cs
- ModuleBuilder.cs
- FileAuthorizationModule.cs
- XmlSchemaValidator.cs
- BaseValidator.cs
- LinqDataView.cs
- HttpRawResponse.cs
- PermissionToken.cs
- CheckBoxRenderer.cs
- TimeSpanStorage.cs
- NativeMethods.cs
- UserPersonalizationStateInfo.cs
- WorkflowEventArgs.cs
- ExtractorMetadata.cs
- TypeConstant.cs
- ContextCorrelationInitializer.cs
- FormViewCommandEventArgs.cs
- FillBehavior.cs
- XmlILConstructAnalyzer.cs
- StaticSiteMapProvider.cs
- StateMachineExecutionState.cs
- AssociationEndMember.cs
- Crypto.cs
- SymmetricKeyWrap.cs
- RegisteredHiddenField.cs
- PreviewPrintController.cs
- HttpStreamMessageEncoderFactory.cs
- CompressStream.cs
- FirstMatchCodeGroup.cs
- DataServiceRequestException.cs
- ItemContainerPattern.cs
- WebPartCollection.cs
- TaiwanCalendar.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- DefaultHttpHandler.cs
- ITreeGenerator.cs
- AuthenticationConfig.cs
- ErasingStroke.cs
- ClickablePoint.cs
- RichTextBoxConstants.cs
- SqlAliaser.cs