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
- ClusterRegistryConfigurationProvider.cs
- TrackingCondition.cs
- OperationAbortedException.cs
- Tokenizer.cs
- Constants.cs
- ZoneMembershipCondition.cs
- Point3DConverter.cs
- ObservableDictionary.cs
- ReflectPropertyDescriptor.cs
- ToolStripDropDownClosedEventArgs.cs
- ServiceProviders.cs
- EncoderParameters.cs
- EncodingDataItem.cs
- MouseDevice.cs
- XmlnsDictionary.cs
- ParseHttpDate.cs
- FileSecurity.cs
- CompiledIdentityConstraint.cs
- ControlDesignerState.cs
- ISAPIRuntime.cs
- AutoResetEvent.cs
- TextCollapsingProperties.cs
- CodeLinePragma.cs
- CheckBoxField.cs
- PropertyGridEditorPart.cs
- TimeIntervalCollection.cs
- ToolStripProgressBar.cs
- DependencyPropertyKey.cs
- Header.cs
- SafeBitVector32.cs
- PageRouteHandler.cs
- PasswordValidationException.cs
- KeysConverter.cs
- SystemIPv4InterfaceProperties.cs
- RootNamespaceAttribute.cs
- InstanceNotReadyException.cs
- SimpleExpression.cs
- RelationshipNavigation.cs
- WebBrowserPermission.cs
- ProcessModuleCollection.cs
- SafeArchiveContext.cs
- UniqueCodeIdentifierScope.cs
- CodeTypeOfExpression.cs
- SafeLocalAllocation.cs
- WebServiceFaultDesigner.cs
- MergeFailedEvent.cs
- relpropertyhelper.cs
- XmlNotation.cs
- DataGridViewImageColumn.cs
- PopupRootAutomationPeer.cs
- Int32Animation.cs
- DesignerLoader.cs
- HelpProvider.cs
- FileNameEditor.cs
- OleCmdHelper.cs
- Track.cs
- OpenTypeCommon.cs
- AppManager.cs
- DesignerActionList.cs
- ClientSettingsProvider.cs
- PageWrapper.cs
- ClientConfigurationSystem.cs
- Roles.cs
- DockPatternIdentifiers.cs
- WebPartManager.cs
- ReadWriteObjectLock.cs
- DataQuery.cs
- HierarchicalDataSourceControl.cs
- EntityDesignerDataSourceView.cs
- WebPartAuthorizationEventArgs.cs
- DateTimeFormatInfoScanner.cs
- RegexGroupCollection.cs
- DriveNotFoundException.cs
- HealthMonitoringSection.cs
- XmlSerializerFactory.cs
- DesignTimeTemplateParser.cs
- BaseValidator.cs
- CombinedGeometry.cs
- SizeConverter.cs
- HelpKeywordAttribute.cs
- HMACSHA512.cs
- NonBatchDirectoryCompiler.cs
- ContextBase.cs
- JumpItem.cs
- DeferredRunTextReference.cs
- ConstructorArgumentAttribute.cs
- SimpleType.cs
- RegularExpressionValidator.cs
- DefaultHttpHandler.cs
- FtpCachePolicyElement.cs
- HexParser.cs
- EventDescriptorCollection.cs
- TypeElementCollection.cs
- PlanCompiler.cs
- RadialGradientBrush.cs
- DictionaryEntry.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DataSvcMapFileSerializer.cs
- CollectionConverter.cs
- LinkedResourceCollection.cs