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
- HMACRIPEMD160.cs
- UriWriter.cs
- Viewport3DAutomationPeer.cs
- Validator.cs
- SystemUnicastIPAddressInformation.cs
- DataRowView.cs
- TableChangeProcessor.cs
- EventProviderWriter.cs
- ParallelTimeline.cs
- ToolStripDropDownItemDesigner.cs
- IteratorFilter.cs
- CodeGroup.cs
- BindingOperations.cs
- DataKey.cs
- ContourSegment.cs
- TableLayoutStyleCollection.cs
- InputChannelBinder.cs
- HMACSHA512.cs
- ConnectionManagementElement.cs
- ConfigurationFileMap.cs
- MessageDecoder.cs
- Signature.cs
- GroupBox.cs
- Column.cs
- HostingEnvironmentException.cs
- StrokeNodeOperations.cs
- RegularExpressionValidator.cs
- SuppressMergeCheckAttribute.cs
- FormViewRow.cs
- BindingValueChangedEventArgs.cs
- XmlSerializerNamespaces.cs
- wgx_exports.cs
- SafeFileMappingHandle.cs
- HtmlEmptyTagControlBuilder.cs
- WebPartsPersonalization.cs
- ResourceCategoryAttribute.cs
- Selector.cs
- EllipseGeometry.cs
- ToolStripContentPanel.cs
- LinqDataSourceEditData.cs
- DataGridViewCheckBoxColumn.cs
- AnnotationResourceChangedEventArgs.cs
- recordstatefactory.cs
- BitmapEffectInput.cs
- followingquery.cs
- BindingOperations.cs
- CodeTypeDeclaration.cs
- BaseHashHelper.cs
- XmlTextReader.cs
- Socket.cs
- ChildrenQuery.cs
- CodeNamespaceImportCollection.cs
- BooleanKeyFrameCollection.cs
- DbConvert.cs
- StylusPlugInCollection.cs
- BroadcastEventHelper.cs
- AnnotationAdorner.cs
- ViewStateException.cs
- PictureBox.cs
- OracleDataAdapter.cs
- RelationshipEndCollection.cs
- HyperLinkDesigner.cs
- ListViewItem.cs
- PersonalizableTypeEntry.cs
- CultureInfoConverter.cs
- DrawingContextWalker.cs
- BitStack.cs
- AutoGeneratedFieldProperties.cs
- InvokeMethodDesigner.xaml.cs
- QueryValue.cs
- SQLSingle.cs
- HttpProtocolReflector.cs
- DelegatingConfigHost.cs
- sqlser.cs
- EdmItemError.cs
- TypeUtil.cs
- SpellerStatusTable.cs
- NGCSerializerAsync.cs
- BatchServiceHost.cs
- BitmapEffectrendercontext.cs
- DisplayInformation.cs
- TaiwanCalendar.cs
- sqlmetadatafactory.cs
- SelectedDatesCollection.cs
- DocumentApplicationJournalEntryEventArgs.cs
- DataGridRowEventArgs.cs
- PageCache.cs
- IdentitySection.cs
- SessionEndingEventArgs.cs
- ZoomPercentageConverter.cs
- TdsParameterSetter.cs
- WebServiceMethodData.cs
- designeractionlistschangedeventargs.cs
- DataGridViewMethods.cs
- OpenCollectionAsyncResult.cs
- ReliableChannelListener.cs
- UIElementAutomationPeer.cs
- FragmentQuery.cs
- Help.cs
- PageAction.cs