Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ListViewCancelEventArgs.cs
- WebPartConnectionsCancelEventArgs.cs
- PolicyLevel.cs
- SystemResourceKey.cs
- XmlBinaryWriterSession.cs
- Attributes.cs
- LeaseManager.cs
- ResourceDescriptionAttribute.cs
- CodeCatchClause.cs
- PageAdapter.cs
- StylusEventArgs.cs
- NotifyInputEventArgs.cs
- FixedSOMLineCollection.cs
- ReferentialConstraintRoleElement.cs
- XComponentModel.cs
- WebPartManagerInternals.cs
- CopyNodeSetAction.cs
- CopyCodeAction.cs
- GridLengthConverter.cs
- SecuritySessionFilter.cs
- QilUnary.cs
- Message.cs
- Vector3DAnimation.cs
- RowToFieldTransformer.cs
- BooleanToVisibilityConverter.cs
- BufferedGraphics.cs
- RootProfilePropertySettingsCollection.cs
- ApplicationException.cs
- XmlNamespaceManager.cs
- PairComparer.cs
- LookupBindingPropertiesAttribute.cs
- CatalogZoneBase.cs
- WindowsIdentity.cs
- XmlBoundElement.cs
- DefaultPrintController.cs
- TreeNodeCollection.cs
- InputLanguageProfileNotifySink.cs
- ReverseComparer.cs
- PackageRelationshipSelector.cs
- RoleBoolean.cs
- LocalizedNameDescriptionPair.cs
- TreeViewImageKeyConverter.cs
- AttributeCollection.cs
- BamlLocalizableResourceKey.cs
- NotifyParentPropertyAttribute.cs
- QuotedPairReader.cs
- EffectiveValueEntry.cs
- ForeignKeyConstraint.cs
- XamlClipboardData.cs
- CalendarDay.cs
- TextCharacters.cs
- Switch.cs
- TypeConverter.cs
- AspNetSynchronizationContext.cs
- HtmlInputButton.cs
- ComplusEndpointConfigContainer.cs
- EncoderReplacementFallback.cs
- SQLInt32.cs
- TagMapInfo.cs
- ToolStripTextBox.cs
- TTSEvent.cs
- CaseStatementProjectedSlot.cs
- WebUtility.cs
- TextRangeEdit.cs
- Empty.cs
- Vector3DAnimationBase.cs
- AssemblyCache.cs
- TableAdapterManagerGenerator.cs
- RedBlackList.cs
- FixedDocumentPaginator.cs
- CellLabel.cs
- EventHandlersStore.cs
- WebRequest.cs
- ScrollEventArgs.cs
- TypeForwardedToAttribute.cs
- ThreadStaticAttribute.cs
- Main.cs
- ApplicationContext.cs
- SingleStorage.cs
- RectValueSerializer.cs
- ItemDragEvent.cs
- RepeaterItemEventArgs.cs
- UdpChannelFactory.cs
- PermissionToken.cs
- PointAnimationClockResource.cs
- XhtmlTextWriter.cs
- ConfigXmlComment.cs
- FormViewCommandEventArgs.cs
- GetMemberBinder.cs
- ThreadBehavior.cs
- ContentPathSegment.cs
- Crypto.cs
- ReferenceEqualityComparer.cs
- FlowDocumentReader.cs
- XmlWriterSettings.cs
- DocumentViewer.cs
- UserControl.cs
- WebPartManagerInternals.cs
- InputElement.cs
- InfoCardAsymmetricCrypto.cs