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
- QilList.cs
- MulticastDelegate.cs
- securestring.cs
- StrokeRenderer.cs
- CompModSwitches.cs
- TextBoxBaseDesigner.cs
- EncoderFallback.cs
- InstanceNotFoundException.cs
- IndexOutOfRangeException.cs
- SecurityTokenResolver.cs
- UnknownWrapper.cs
- DrawingContext.cs
- ListBindingConverter.cs
- WorkflowFileItem.cs
- QilParameter.cs
- SqlDataSourceCache.cs
- AutomationPropertyInfo.cs
- GuidTagList.cs
- AbstractDataSvcMapFileLoader.cs
- Mappings.cs
- ScriptingSectionGroup.cs
- BindingListCollectionView.cs
- HtmlAnchor.cs
- DrawingGroupDrawingContext.cs
- ScriptControlManager.cs
- TextBoxView.cs
- TrackingParameters.cs
- BindingCollection.cs
- DynamicMetaObject.cs
- DataContractSerializerOperationGenerator.cs
- HyperLinkStyle.cs
- CustomLineCap.cs
- CodeAttributeArgumentCollection.cs
- TextEmbeddedObject.cs
- ShapeTypeface.cs
- ResXResourceReader.cs
- ClockGroup.cs
- DataSourceGroupCollection.cs
- DataErrorValidationRule.cs
- PagesSection.cs
- SymbolType.cs
- TextRange.cs
- MatrixIndependentAnimationStorage.cs
- LabelAutomationPeer.cs
- Dump.cs
- Metafile.cs
- Merger.cs
- StructuredType.cs
- ListCardsInFileRequest.cs
- EndEvent.cs
- NodeLabelEditEvent.cs
- DragStartedEventArgs.cs
- ConfigurationCollectionAttribute.cs
- TemplateInstanceAttribute.cs
- ComponentRenameEvent.cs
- Queue.cs
- GenericsInstances.cs
- sqlpipe.cs
- RoamingStoreFileUtility.cs
- FormsAuthentication.cs
- TextOutput.cs
- ThreadAbortException.cs
- NumericUpDown.cs
- StickyNoteHelper.cs
- DrawingBrush.cs
- SingleTagSectionHandler.cs
- SqlConnectionPoolProviderInfo.cs
- XmlWrappingReader.cs
- AbandonedMutexException.cs
- FileDialog_Vista.cs
- PackageDigitalSignature.cs
- ThemeableAttribute.cs
- ObjectSpanRewriter.cs
- DataTable.cs
- HttpCachePolicyElement.cs
- UriTemplateLiteralPathSegment.cs
- WriteableOnDemandPackagePart.cs
- CopyOnWriteList.cs
- BrushMappingModeValidation.cs
- SmtpMail.cs
- StorageAssociationSetMapping.cs
- MatrixTransform.cs
- Geometry.cs
- ObjectPropertyMapping.cs
- ZipPackage.cs
- WpfGeneratedKnownProperties.cs
- DataGridItemCollection.cs
- IdentitySection.cs
- baseaxisquery.cs
- FontFamily.cs
- CultureInfoConverter.cs
- Version.cs
- ReflectPropertyDescriptor.cs
- DataSourceExpression.cs
- EntityCommandDefinition.cs
- CommandEventArgs.cs
- TypeConverter.cs
- ScalarType.cs
- ExclusiveTcpTransportManager.cs
- WebPartPersonalization.cs