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
- InternalBufferOverflowException.cs
- TimeIntervalCollection.cs
- PersonalizationStateInfoCollection.cs
- XmlNamespaceMappingCollection.cs
- HtmlElement.cs
- DataServiceOperationContext.cs
- Header.cs
- PropertyItem.cs
- _ScatterGatherBuffers.cs
- DataGridViewSelectedCellCollection.cs
- SplitterPanel.cs
- RequestCachePolicy.cs
- MessageHeaderAttribute.cs
- ChangePassword.cs
- NestPullup.cs
- EventWaitHandle.cs
- HMACSHA1.cs
- RequestCachePolicyConverter.cs
- WCFModelStrings.Designer.cs
- ListViewGroupItemCollection.cs
- DataControlExtensions.cs
- Win32MouseDevice.cs
- SqlCrossApplyToCrossJoin.cs
- NullableConverter.cs
- AspNetHostingPermission.cs
- ObjectDataSourceFilteringEventArgs.cs
- HeaderCollection.cs
- InstanceHandle.cs
- DispatchChannelSink.cs
- TypeValidationEventArgs.cs
- MailAddress.cs
- BlurEffect.cs
- AsynchronousChannelMergeEnumerator.cs
- WrapPanel.cs
- Vector3DAnimationBase.cs
- OAVariantLib.cs
- Stack.cs
- SmtpReplyReader.cs
- HuffmanTree.cs
- FilterableAttribute.cs
- DataBindEngine.cs
- VisualBasicExpressionConverter.cs
- XmlSchemaParticle.cs
- FlowDocumentPaginator.cs
- FlowStep.cs
- ResourceReferenceKeyNotFoundException.cs
- SecurityToken.cs
- DecoderReplacementFallback.cs
- PriorityItem.cs
- LogLogRecordHeader.cs
- ClockController.cs
- Pair.cs
- ListDictionary.cs
- PageClientProxyGenerator.cs
- NumericExpr.cs
- ZoneMembershipCondition.cs
- SqlClientPermission.cs
- SchemaElement.cs
- UmAlQuraCalendar.cs
- PageClientProxyGenerator.cs
- SiteMapNode.cs
- WebHttpDispatchOperationSelectorData.cs
- ReaderContextStackData.cs
- TabPage.cs
- BaseTemplateBuildProvider.cs
- ColorBlend.cs
- ContractInferenceHelper.cs
- MouseEventArgs.cs
- TreeNodeSelectionProcessor.cs
- StatusBarPanel.cs
- ServiceModelActivationSectionGroup.cs
- ConnectionProviderAttribute.cs
- XmlSerializerVersionAttribute.cs
- DbProviderFactoriesConfigurationHandler.cs
- documentsequencetextview.cs
- MessageQueuePermissionAttribute.cs
- StateDesigner.Helpers.cs
- SmiMetaData.cs
- PipelineModuleStepContainer.cs
- ViewKeyConstraint.cs
- NonVisualControlAttribute.cs
- XmlSerializationWriter.cs
- SID.cs
- DockPattern.cs
- PersonalizablePropertyEntry.cs
- XamlInt32CollectionSerializer.cs
- ModuleConfigurationInfo.cs
- RadioButton.cs
- ImageMetadata.cs
- SqlProcedureAttribute.cs
- NotifyInputEventArgs.cs
- DocumentReferenceCollection.cs
- OleDbReferenceCollection.cs
- DPAPIProtectedConfigurationProvider.cs
- XmlParser.cs
- ITreeGenerator.cs
- GatewayDefinition.cs
- SqlTrackingService.cs
- RowToFieldTransformer.cs
- SvcMapFileSerializer.cs