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
- ProcessManager.cs
- MarshalDirectiveException.cs
- DataGridViewHitTestInfo.cs
- CachedBitmap.cs
- ConfigurationSection.cs
- SchemaSetCompiler.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- Thread.cs
- xmlsaver.cs
- WebException.cs
- GatewayDefinition.cs
- QilChoice.cs
- RequestSecurityTokenResponse.cs
- LicenseContext.cs
- NameService.cs
- WebAdminConfigurationHelper.cs
- ManualResetEvent.cs
- SqlServices.cs
- EncoderExceptionFallback.cs
- ServiceBusyException.cs
- userdatakeys.cs
- StorageInfo.cs
- CookieHandler.cs
- UserUseLicenseDictionaryLoader.cs
- BounceEase.cs
- ClassValidator.cs
- SiteMembershipCondition.cs
- StatusBar.cs
- Identifier.cs
- CqlErrorHelper.cs
- OracleBFile.cs
- GeometryCollection.cs
- HttpConfigurationSystem.cs
- TakeQueryOptionExpression.cs
- NotCondition.cs
- XmlSerializer.cs
- NetworkCredential.cs
- DesignerDataSourceView.cs
- ColumnProvider.cs
- ScriptBehaviorDescriptor.cs
- TemplateBamlRecordReader.cs
- DataControlPagerLinkButton.cs
- VisualStyleTypesAndProperties.cs
- ChameleonKey.cs
- TabRenderer.cs
- RegistryKey.cs
- KeyboardDevice.cs
- ReceiveDesigner.xaml.cs
- CallbackTimeoutsBehavior.cs
- dsa.cs
- MenuCommandsChangedEventArgs.cs
- TraceListeners.cs
- CultureInfoConverter.cs
- PreviewPrintController.cs
- Console.cs
- ResourceCodeDomSerializer.cs
- CommandEventArgs.cs
- PanelContainerDesigner.cs
- GetPolicyDetailsRequest.cs
- DuplicateDetector.cs
- PerformanceCounterPermission.cs
- XmlAnyAttributeAttribute.cs
- SchemaImporterExtensionsSection.cs
- ExtensionQuery.cs
- NativeMethods.cs
- PopupRootAutomationPeer.cs
- Column.cs
- EndOfStreamException.cs
- SslStreamSecurityElement.cs
- wgx_render.cs
- NonVisualControlAttribute.cs
- DesignerFrame.cs
- RemotingConfigParser.cs
- CreateUserErrorEventArgs.cs
- ProgressBar.cs
- QilExpression.cs
- WCFServiceClientProxyGenerator.cs
- ContractValidationHelper.cs
- HiddenField.cs
- BufferModeSettings.cs
- TreeNode.cs
- WebBrowser.cs
- ProviderCollection.cs
- XPathExpr.cs
- TableRow.cs
- InputBinder.cs
- InfiniteTimeSpanConverter.cs
- CSharpCodeProvider.cs
- UITypeEditor.cs
- SqlUserDefinedTypeAttribute.cs
- FormsAuthenticationTicket.cs
- SelfIssuedAuthAsymmetricKey.cs
- PropertyInfoSet.cs
- TypeReference.cs
- PolyQuadraticBezierSegment.cs
- PeerCollaboration.cs
- GeometryModel3D.cs
- FileNotFoundException.cs
- RSAOAEPKeyExchangeFormatter.cs
- unitconverter.cs