Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Page.cs
- WindowsStartMenu.cs
- TransactionManager.cs
- Opcode.cs
- TreeNodeStyle.cs
- AssemblySettingAttributes.cs
- CompoundFileStorageReference.cs
- PageParser.cs
- Span.cs
- _NetRes.cs
- MulticastNotSupportedException.cs
- Profiler.cs
- KeyGestureConverter.cs
- XmlValidatingReaderImpl.cs
- PropertyChangeTracker.cs
- BitmapCache.cs
- CollectionViewGroupInternal.cs
- ObjectSecurity.cs
- StylusPoint.cs
- SyndicationElementExtension.cs
- AutoGeneratedField.cs
- FlowLayoutPanel.cs
- MsmqNonTransactedPoisonHandler.cs
- StrongNameMembershipCondition.cs
- ColumnWidthChangedEvent.cs
- Number.cs
- COM2IDispatchConverter.cs
- VirtualDirectoryMapping.cs
- ParserContext.cs
- DataGridViewCellStyleEditor.cs
- Baml6ConstructorInfo.cs
- DownloadProgressEventArgs.cs
- FileDataSource.cs
- HwndMouseInputProvider.cs
- DataView.cs
- CompilationSection.cs
- ListBoxAutomationPeer.cs
- ListControlConvertEventArgs.cs
- ProxyFragment.cs
- CodeFieldReferenceExpression.cs
- AttributedMetaModel.cs
- HttpHandlerAction.cs
- UndoManager.cs
- PersonalizationAdministration.cs
- ContainsRowNumberChecker.cs
- BidPrivateBase.cs
- DataRowIndexBuffer.cs
- EncodingDataItem.cs
- AnnotationDocumentPaginator.cs
- FrameworkElementFactory.cs
- GuidConverter.cs
- OdbcPermission.cs
- QueryResponse.cs
- ConstrainedDataObject.cs
- Atom10FormatterFactory.cs
- Region.cs
- DataGridItemAttachedStorage.cs
- ComponentConverter.cs
- ReferenceEqualityComparer.cs
- SspiSafeHandles.cs
- DefaultMemberAttribute.cs
- PassportPrincipal.cs
- Timer.cs
- WebServiceFaultDesigner.cs
- ResourceSetExpression.cs
- MsdtcWrapper.cs
- DataKeyCollection.cs
- HostVisual.cs
- BamlRecordHelper.cs
- SpStreamWrapper.cs
- UnsafeNativeMethods.cs
- InternalsVisibleToAttribute.cs
- FixedTextContainer.cs
- ImmutableObjectAttribute.cs
- SelectorAutomationPeer.cs
- ClaimTypes.cs
- ButtonBase.cs
- BevelBitmapEffect.cs
- SqlGenericUtil.cs
- Dictionary.cs
- GridPatternIdentifiers.cs
- PkcsUtils.cs
- SelectionItemProviderWrapper.cs
- DynamicPropertyHolder.cs
- DispatcherOperation.cs
- ContentTextAutomationPeer.cs
- NotSupportedException.cs
- WebPartConnection.cs
- GuidTagList.cs
- TokenCreationException.cs
- OleDbSchemaGuid.cs
- SqlConnectionStringBuilder.cs
- TdsParserSessionPool.cs
- XmlComplianceUtil.cs
- _Events.cs
- InvokePattern.cs
- SHA512Managed.cs
- VScrollBar.cs
- SecurityPolicySection.cs
- DataObjectAttribute.cs