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
- CollectionViewProxy.cs
- Style.cs
- SessionStateModule.cs
- ObjectAnimationBase.cs
- EdmType.cs
- TypeFieldSchema.cs
- FileEnumerator.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- GeneralTransform2DTo3D.cs
- ExplicitDiscriminatorMap.cs
- SqlNodeTypeOperators.cs
- Switch.cs
- QueryStringConverter.cs
- SettingsBase.cs
- ZeroOpNode.cs
- PresentationTraceSources.cs
- IntegerValidator.cs
- MatrixTransform.cs
- DefaultMemberAttribute.cs
- _ScatterGatherBuffers.cs
- DetailsViewDeleteEventArgs.cs
- SqlBuilder.cs
- MeasureItemEvent.cs
- ResetableIterator.cs
- CodeBinaryOperatorExpression.cs
- OneToOneMappingSerializer.cs
- HtmlControlPersistable.cs
- TreeIterator.cs
- XmlElement.cs
- GridEntry.cs
- ObjectCacheSettings.cs
- LogicalTreeHelper.cs
- PropertyEmitter.cs
- _ListenerResponseStream.cs
- NamedObject.cs
- ComUdtElement.cs
- _UncName.cs
- EndOfStreamException.cs
- HttpBufferlessInputStream.cs
- JavaScriptString.cs
- xsdvalidator.cs
- MultiDataTrigger.cs
- XmlSortKey.cs
- TypeNameConverter.cs
- ColumnResult.cs
- FileVersionInfo.cs
- MessageLogger.cs
- BlobPersonalizationState.cs
- selecteditemcollection.cs
- FtpCachePolicyElement.cs
- ToolStripSplitStackLayout.cs
- X509ChainElement.cs
- NameValueSectionHandler.cs
- HttpRequestBase.cs
- DelegatingConfigHost.cs
- DataGridViewCellCancelEventArgs.cs
- EnumDataContract.cs
- TextEditorSpelling.cs
- TextDecorationCollection.cs
- EventDriven.cs
- Form.cs
- DataSourceProvider.cs
- TransformedBitmap.cs
- HttpsHostedTransportConfiguration.cs
- SizeAnimationUsingKeyFrames.cs
- ByteStorage.cs
- RangeExpression.cs
- FixedPageAutomationPeer.cs
- DbBuffer.cs
- ReliabilityContractAttribute.cs
- GuidelineCollection.cs
- XmlQueryRuntime.cs
- EdmToObjectNamespaceMap.cs
- FontNamesConverter.cs
- MachineKeySection.cs
- BooleanToVisibilityConverter.cs
- EntityAdapter.cs
- Path.cs
- CultureInfoConverter.cs
- XsltException.cs
- LocationSectionRecord.cs
- DataGridSortCommandEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- TreeViewDesigner.cs
- TitleStyle.cs
- HtmlProps.cs
- SqlConnectionStringBuilder.cs
- CompatibleComparer.cs
- StringExpressionSet.cs
- IndentedWriter.cs
- _NegotiateClient.cs
- ZipIOExtraFieldZip64Element.cs
- ListCollectionView.cs
- SoundPlayerAction.cs
- CompensatableSequenceActivity.cs
- SqlDuplicator.cs
- DesignerCommandAdapter.cs
- Propagator.ExtentPlaceholderCreator.cs
- SignatureToken.cs
- AutomationPatternInfo.cs