Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / RtfFormatStack.cs / 1305600 / 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
- ScrollProperties.cs
- MetabaseSettings.cs
- CounterCreationData.cs
- PackageRelationshipCollection.cs
- MetadataFile.cs
- SplitContainerDesigner.cs
- TypeResolver.cs
- LoginUtil.cs
- CustomAssemblyResolver.cs
- BrowserCapabilitiesCompiler.cs
- ModifiableIteratorCollection.cs
- CommentAction.cs
- StackBuilderSink.cs
- Error.cs
- WindowCollection.cs
- OutputCacheEntry.cs
- WrappedIUnknown.cs
- TemplateParser.cs
- DeflateInput.cs
- ObjectHandle.cs
- ScrollBar.cs
- ApplicationInterop.cs
- PeekCompletedEventArgs.cs
- InfoCardMetadataExchangeClient.cs
- ObjectFullSpanRewriter.cs
- WorkerProcess.cs
- TableItemProviderWrapper.cs
- StreamUpdate.cs
- JournalEntryListConverter.cs
- XamlReaderHelper.cs
- NameScope.cs
- ElementUtil.cs
- UnionExpr.cs
- ByteAnimationUsingKeyFrames.cs
- FormsIdentity.cs
- ModifierKeysValueSerializer.cs
- XmlMemberMapping.cs
- MethodRental.cs
- WorkflowPrinting.cs
- BuildProviderUtils.cs
- AuthenticateEventArgs.cs
- Context.cs
- StringSource.cs
- TextTreeExtractElementUndoUnit.cs
- DbConnectionPoolGroupProviderInfo.cs
- ObfuscateAssemblyAttribute.cs
- Model3DCollection.cs
- BinaryMethodMessage.cs
- AsymmetricSignatureFormatter.cs
- StatusBarPanel.cs
- CollectionViewSource.cs
- BaseValidator.cs
- PointHitTestResult.cs
- SafeFileHandle.cs
- ExponentialEase.cs
- DiscoveryExceptionDictionary.cs
- SafeNativeMethodsCLR.cs
- SplitterPanelDesigner.cs
- ConnectionOrientedTransportManager.cs
- LiteralText.cs
- RefreshEventArgs.cs
- QilXmlReader.cs
- ThreadExceptionEvent.cs
- FieldTemplateUserControl.cs
- WindowsAuthenticationModule.cs
- XPathEmptyIterator.cs
- DynamicDocumentPaginator.cs
- SamlAuthenticationStatement.cs
- ShaperBuffers.cs
- CellParagraph.cs
- PrefixHandle.cs
- Nullable.cs
- ServiceOperationWrapper.cs
- ProxyWebPartConnectionCollection.cs
- TdsParser.cs
- PolicyAssertionCollection.cs
- SqlInternalConnection.cs
- SchemaNamespaceManager.cs
- GroupBoxRenderer.cs
- TextReturnReader.cs
- WindowInteropHelper.cs
- SqlTriggerAttribute.cs
- SortableBindingList.cs
- Image.cs
- Point.cs
- XmlObjectSerializerWriteContext.cs
- VideoDrawing.cs
- SymDocumentType.cs
- TextSelectionProcessor.cs
- ColorConverter.cs
- PolyBezierSegmentFigureLogic.cs
- UshortList2.cs
- InternalControlCollection.cs
- Cursors.cs
- ActivityUtilities.cs
- DataBoundControl.cs
- StandardCommands.cs
- SafeNativeMethods.cs
- DispatcherObject.cs
- FixedPage.cs