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
- InvalidProgramException.cs
- ValueTypeFixupInfo.cs
- DrawingGroupDrawingContext.cs
- CorruptStoreException.cs
- XPathDocument.cs
- HelpOperationInvoker.cs
- TreeNodeCollectionEditorDialog.cs
- HeaderedContentControl.cs
- LinkTarget.cs
- Keyboard.cs
- Soap.cs
- TextViewElement.cs
- TextTabProperties.cs
- OdbcConnectionHandle.cs
- Table.cs
- EtwTrace.cs
- CheckBoxPopupAdapter.cs
- Parameter.cs
- Transform3DGroup.cs
- TableAutomationPeer.cs
- PartManifestEntry.cs
- FixedSOMTable.cs
- ItemContainerProviderWrapper.cs
- WindowsEditBoxRange.cs
- SchemaTableColumn.cs
- TransformPatternIdentifiers.cs
- Encoding.cs
- OpenFileDialog.cs
- ConnectionStringsExpressionBuilder.cs
- DbQueryCommandTree.cs
- WebExceptionStatus.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- ContractCodeDomInfo.cs
- QilTypeChecker.cs
- AssertHelper.cs
- AuthenticationModulesSection.cs
- FormViewInsertEventArgs.cs
- DbModificationClause.cs
- ExceptionAggregator.cs
- EntityCommandDefinition.cs
- ModifierKeysConverter.cs
- DragDeltaEventArgs.cs
- DataSpaceManager.cs
- BitmapEffectDrawingContextState.cs
- TreeView.cs
- IDReferencePropertyAttribute.cs
- PtsPage.cs
- SafeRightsManagementHandle.cs
- ImageInfo.cs
- ObjectRef.cs
- KeyValueConfigurationElement.cs
- CreateWorkflowOwnerCommand.cs
- DesignerToolStripControlHost.cs
- Types.cs
- SecUtil.cs
- FramingDecoders.cs
- InteropAutomationProvider.cs
- MenuCommand.cs
- RemoteWebConfigurationHostStream.cs
- PathGeometry.cs
- ManipulationStartingEventArgs.cs
- EndEvent.cs
- ExtentCqlBlock.cs
- ListItemConverter.cs
- GridLengthConverter.cs
- SendMailErrorEventArgs.cs
- EncryptedXml.cs
- Calendar.cs
- Exceptions.cs
- RedistVersionInfo.cs
- StringPropertyBuilder.cs
- RewritingSimplifier.cs
- JournalNavigationScope.cs
- ButtonBaseAutomationPeer.cs
- BookmarkManager.cs
- XmlWriterTraceListener.cs
- PropertyReferenceSerializer.cs
- ProtocolsSection.cs
- ModulesEntry.cs
- EnumValAlphaComparer.cs
- SqlResolver.cs
- EdmItemError.cs
- FlowDocumentView.cs
- RouteItem.cs
- _FtpControlStream.cs
- OracleFactory.cs
- QilXmlReader.cs
- TextTreeInsertElementUndoUnit.cs
- XmlSchemaValidationException.cs
- MsmqIntegrationInputMessage.cs
- HandlerFactoryCache.cs
- ClientSettingsSection.cs
- TextDecoration.cs
- GeneralTransform.cs
- StrokeNodeData.cs
- Model3DGroup.cs
- AllMembershipCondition.cs
- FragmentQuery.cs
- SqlDataSource.cs
- SerializationSectionGroup.cs