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
- FormViewRow.cs
- FontInfo.cs
- ByteStreamMessageEncoder.cs
- KeyValuePairs.cs
- FormattedTextSymbols.cs
- SQLBoolean.cs
- RowCache.cs
- AttachInfo.cs
- ExtendedPropertyInfo.cs
- XmlElementList.cs
- DataGridViewCellConverter.cs
- ClientSponsor.cs
- HttpCacheParams.cs
- FieldAccessException.cs
- WaitHandleCannotBeOpenedException.cs
- KeyEvent.cs
- CommonDialog.cs
- PropertyTabChangedEvent.cs
- DataGridViewColumnCollection.cs
- Serializer.cs
- MimePart.cs
- TextDecoration.cs
- CodeSnippetCompileUnit.cs
- LocalsItemDescription.cs
- DataSourceControlBuilder.cs
- BufferBuilder.cs
- MaskedTextBoxTextEditorDropDown.cs
- DivideByZeroException.cs
- FillErrorEventArgs.cs
- AxParameterData.cs
- TouchesCapturedWithinProperty.cs
- RowType.cs
- TimeSpanHelper.cs
- Directory.cs
- PageThemeParser.cs
- TargetException.cs
- HtmlLink.cs
- CodeTypeReference.cs
- EditorZoneAutoFormat.cs
- NetworkInformationPermission.cs
- RectangleF.cs
- ImageField.cs
- ControlBuilderAttribute.cs
- Brush.cs
- ProgressBar.cs
- InfocardInteractiveChannelInitializer.cs
- BitStack.cs
- UriScheme.cs
- VectorCollection.cs
- GPPOINTF.cs
- XmlUtil.cs
- LocalBuilder.cs
- OAVariantLib.cs
- WindowsClaimSet.cs
- AssemblyAttributes.cs
- ConfigXmlReader.cs
- XamlValidatingReader.cs
- InvalidStoreProtectionKeyException.cs
- DataGridAddNewRow.cs
- DataControlField.cs
- CodeAccessPermission.cs
- ContractBase.cs
- TextTreeText.cs
- FunctionImportMapping.cs
- ContextDataSourceContextData.cs
- DiscardableAttribute.cs
- JpegBitmapEncoder.cs
- MexHttpBindingCollectionElement.cs
- Version.cs
- SystemInfo.cs
- SecurityRuntime.cs
- Pair.cs
- Int32RectConverter.cs
- QueryParameter.cs
- AspNetHostingPermission.cs
- CommonDialog.cs
- BindToObject.cs
- PropertyPathConverter.cs
- Drawing.cs
- DisplayInformation.cs
- AsyncSerializedWorker.cs
- DrawTreeNodeEventArgs.cs
- KeyManager.cs
- ProxyManager.cs
- ZoneButton.cs
- TextViewSelectionProcessor.cs
- PackageDigitalSignature.cs
- SecurityNegotiationException.cs
- ImageField.cs
- InvalidAsynchronousStateException.cs
- WindowsScroll.cs
- WebReferencesBuildProvider.cs
- Int64Animation.cs
- ByteRangeDownloader.cs
- UTF8Encoding.cs
- MultipartContentParser.cs
- StringDictionaryCodeDomSerializer.cs
- DictionarySurrogate.cs
- TokenizerHelper.cs
- CodeTypeParameter.cs