Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Documents / RtfFormatStack.cs / 1 / RtfFormatStack.cs
//---------------------------------------------------------------------------- // // File: RtfFormatStack.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Rtf format stack. // //--------------------------------------------------------------------------- using System.Collections; using MS.Internal; // Invariant namespace System.Windows.Documents { ////// RtfFormatStack /// internal class RtfFormatStack : ArrayList { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal RtfFormatStack() : base(20) { } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods internal void Push() { FormatState previousFormatState = Top(); FormatState formatState; formatState = previousFormatState != null ? new FormatState(previousFormatState) : new FormatState(); Add(formatState); } internal void Pop() { Invariant.Assert(Count != 0); if (Count > 0) { RemoveAt(Count - 1); } } internal FormatState Top() { return Count > 0 ? EntryAt(Count - 1) : null; } internal FormatState PrevTop(int fromTop) { int index = Count - 1 - fromTop; if (index < 0 || index >= Count) { return null; } return EntryAt(index); } internal FormatState EntryAt(int index) { return (FormatState)this[index]; } #endregion Internal Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: RtfFormatStack.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Rtf format stack. // //--------------------------------------------------------------------------- using System.Collections; using MS.Internal; // Invariant namespace System.Windows.Documents { ////// RtfFormatStack /// internal class RtfFormatStack : ArrayList { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors internal RtfFormatStack() : base(20) { } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods internal void Push() { FormatState previousFormatState = Top(); FormatState formatState; formatState = previousFormatState != null ? new FormatState(previousFormatState) : new FormatState(); Add(formatState); } internal void Pop() { Invariant.Assert(Count != 0); if (Count > 0) { RemoveAt(Count - 1); } } internal FormatState Top() { return Count > 0 ? EntryAt(Count - 1) : null; } internal FormatState PrevTop(int fromTop) { int index = Count - 1 - fromTop; if (index < 0 || index >= Count) { return null; } return EntryAt(index); } internal FormatState EntryAt(int index) { return (FormatState)this[index]; } #endregion Internal Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XamlNamespaceHelper.cs
- DataGridAutomationPeer.cs
- AppSettingsExpressionBuilder.cs
- PasswordPropertyTextAttribute.cs
- TreeWalker.cs
- Int64Storage.cs
- DataBindingList.cs
- EncodedStreamFactory.cs
- MsmqIntegrationChannelFactory.cs
- VisualTarget.cs
- Point3D.cs
- ZipIOLocalFileBlock.cs
- QueuePropertyVariants.cs
- ModifiableIteratorCollection.cs
- PrefixHandle.cs
- TcpAppDomainProtocolHandler.cs
- DataServiceException.cs
- CodeCompiler.cs
- SmtpNtlmAuthenticationModule.cs
- DoubleConverter.cs
- Pointer.cs
- ReferenceEqualityComparer.cs
- CodeAttributeDeclarationCollection.cs
- SynchronizingStream.cs
- SqlMethodAttribute.cs
- NullableBoolConverter.cs
- ScrollItemProviderWrapper.cs
- SqlDataSourceFilteringEventArgs.cs
- CodeAssignStatement.cs
- ResourceManager.cs
- Events.cs
- PnrpPermission.cs
- clipboard.cs
- IndependentAnimationStorage.cs
- SqlCacheDependencyDatabaseCollection.cs
- SerialPort.cs
- OutputCacheSettings.cs
- TableNameAttribute.cs
- precedingquery.cs
- EntityViewContainer.cs
- CompilerWrapper.cs
- TrackBarRenderer.cs
- BamlLocalizer.cs
- TrailingSpaceComparer.cs
- HtmlTableCell.cs
- SettingsBase.cs
- RowToParametersTransformer.cs
- WebServiceBindingAttribute.cs
- EntityViewGenerationAttribute.cs
- DoubleAnimationUsingPath.cs
- DeclarativeCatalogPartDesigner.cs
- SupportingTokenParameters.cs
- FilterException.cs
- Timer.cs
- IncrementalCompileAnalyzer.cs
- FacetDescriptionElement.cs
- MessageQueuePermissionEntryCollection.cs
- MenuStrip.cs
- OleCmdHelper.cs
- TextParagraph.cs
- BeginEvent.cs
- PostBackTrigger.cs
- ZipIOFileItemStream.cs
- TableRowsCollectionEditor.cs
- Variable.cs
- CachedTypeface.cs
- QuaternionIndependentAnimationStorage.cs
- DecoderExceptionFallback.cs
- ProxyHelper.cs
- TextBoxDesigner.cs
- Attributes.cs
- cookieexception.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- HttpDictionary.cs
- XmlSchema.cs
- TokenBasedSet.cs
- BinaryObjectInfo.cs
- DataGridBoolColumn.cs
- PackageFilter.cs
- SQLChars.cs
- SizeConverter.cs
- NativeMethods.cs
- SoapHttpTransportImporter.cs
- StreamWriter.cs
- QueryStringParameter.cs
- NameTable.cs
- ResourceContainer.cs
- SoapAttributeOverrides.cs
- AppDomainProtocolHandler.cs
- SimpleHandlerBuildProvider.cs
- AlternateViewCollection.cs
- HierarchicalDataSourceControl.cs
- SchemaMapping.cs
- DocumentViewerBase.cs
- ProxyRpc.cs
- CatalogPartCollection.cs
- SectionInput.cs
- SQLCharsStorage.cs
- httpapplicationstate.cs
- IFlowDocumentViewer.cs