Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / textformatting / TextRunCache.cs / 1 / TextRunCache.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2001 // // File: TextRunCache.cs // // Contents: Cache of text and text properties of run // // Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc // // Created: 2-25-2003 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- using System; using System.Collections.Generic; using MS.Internal.PresentationCore; using MS.Internal.TextFormatting; namespace System.Windows.Media.TextFormatting { ////// TextFormatter caches runs it receives from GetTextRun callback. This cache /// object is managed by text layout client. /// /// This method is used to improve performance in application whose fetching the /// run has significant performance implication. Application using this caching /// mechanism is responsible for invalidating the content in the cache when /// its changed. /// public sealed class TextRunCache { ////// Constructing text run cache /// public TextRunCache() {} ////// Client to notify change in part of the cache when text or /// properties of the run is being added, removed or replaced. /// /// text source character index to specify where in the source text the change starts. /// the number of text source characters to be added in the source text /// the number of text source characters to be removed in the source text public void Change( int textSourceCharacterIndex, int addition, int removal ) { if(_imp != null) { _imp.Change( textSourceCharacterIndex, addition, removal ); } } ////// Client to invalidate the whole cache, in effect emptying the cache and /// cause the cache refill in subsequent call to Text Formatting API. /// public void Invalidate() { if(_imp != null) { _imp = null; } } ////// Return all cached TextRun in a TextSpan list. If TextRun is not cached for a particular character range, /// the TextSpan would contain null TextRun object. /// #if OPTIMALBREAK_API public IList> GetTextRunSpans() #else [FriendAccessAllowed] internal IList > GetTextRunSpans() #endif { if (_imp != null) { return _imp.GetTextRunSpans(); } // otherwise, return an empty collection return new TextSpan [0]; } /// /// Get/set the actual cache instance /// internal TextRunCacheImp Imp { get { return _imp; } set { _imp = value; } } private TextRunCacheImp _imp; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2001 // // File: TextRunCache.cs // // Contents: Cache of text and text properties of run // // Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc // // Created: 2-25-2003 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- using System; using System.Collections.Generic; using MS.Internal.PresentationCore; using MS.Internal.TextFormatting; namespace System.Windows.Media.TextFormatting { ////// TextFormatter caches runs it receives from GetTextRun callback. This cache /// object is managed by text layout client. /// /// This method is used to improve performance in application whose fetching the /// run has significant performance implication. Application using this caching /// mechanism is responsible for invalidating the content in the cache when /// its changed. /// public sealed class TextRunCache { ////// Constructing text run cache /// public TextRunCache() {} ////// Client to notify change in part of the cache when text or /// properties of the run is being added, removed or replaced. /// /// text source character index to specify where in the source text the change starts. /// the number of text source characters to be added in the source text /// the number of text source characters to be removed in the source text public void Change( int textSourceCharacterIndex, int addition, int removal ) { if(_imp != null) { _imp.Change( textSourceCharacterIndex, addition, removal ); } } ////// Client to invalidate the whole cache, in effect emptying the cache and /// cause the cache refill in subsequent call to Text Formatting API. /// public void Invalidate() { if(_imp != null) { _imp = null; } } ////// Return all cached TextRun in a TextSpan list. If TextRun is not cached for a particular character range, /// the TextSpan would contain null TextRun object. /// #if OPTIMALBREAK_API public IList> GetTextRunSpans() #else [FriendAccessAllowed] internal IList > GetTextRunSpans() #endif { if (_imp != null) { return _imp.GetTextRunSpans(); } // otherwise, return an empty collection return new TextSpan [0]; } /// /// Get/set the actual cache instance /// internal TextRunCacheImp Imp { get { return _imp; } set { _imp = value; } } private TextRunCacheImp _imp; } } // 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
- GridViewRowPresenter.cs
- XmlEventCache.cs
- EventMappingSettingsCollection.cs
- MulticastOption.cs
- SignedPkcs7.cs
- Package.cs
- XmlNavigatorFilter.cs
- CodeThrowExceptionStatement.cs
- GacUtil.cs
- ImageResources.Designer.cs
- securitycriticaldataClass.cs
- AdapterUtil.cs
- DoubleLinkListEnumerator.cs
- DataGridViewAdvancedBorderStyle.cs
- EditorPartChrome.cs
- CacheAxisQuery.cs
- DetailsViewModeEventArgs.cs
- DataSourceHelper.cs
- CultureTable.cs
- CommunicationObjectFaultedException.cs
- TextEditor.cs
- MatchingStyle.cs
- StoryFragments.cs
- AssemblyCache.cs
- SpellerHighlightLayer.cs
- BackgroundFormatInfo.cs
- WindowPatternIdentifiers.cs
- CornerRadiusConverter.cs
- MessagingActivityHelper.cs
- AnimationClock.cs
- DNS.cs
- MessageQueuePermissionEntry.cs
- XpsColorContext.cs
- WaitHandleCannotBeOpenedException.cs
- TableDetailsCollection.cs
- PropertyEmitter.cs
- SortDescriptionCollection.cs
- FillRuleValidation.cs
- CancelEventArgs.cs
- PersonalizationStateQuery.cs
- PropertyDescriptor.cs
- DropAnimation.xaml.cs
- ListBoxItemWrapperAutomationPeer.cs
- SessionPageStateSection.cs
- UTF8Encoding.cs
- _AcceptOverlappedAsyncResult.cs
- SafeArrayRankMismatchException.cs
- HttpCacheVary.cs
- PageTheme.cs
- Page.cs
- MessageBox.cs
- CounterCreationDataCollection.cs
- ComplexBindingPropertiesAttribute.cs
- ResXResourceSet.cs
- AppLevelCompilationSectionCache.cs
- SoapHelper.cs
- Console.cs
- HtmlFormWrapper.cs
- DataGridRowsPresenter.cs
- VisualBasicValue.cs
- SystemGatewayIPAddressInformation.cs
- BamlRecordWriter.cs
- HashCryptoHandle.cs
- _PooledStream.cs
- DataAccessor.cs
- MetabaseServerConfig.cs
- PropertyOrder.cs
- CharUnicodeInfo.cs
- BuildProviderCollection.cs
- PieceDirectory.cs
- RegexCapture.cs
- RadioButtonPopupAdapter.cs
- Logging.cs
- StringComparer.cs
- SchemaImporterExtensionElement.cs
- SqlBuilder.cs
- Visitors.cs
- RedirectionProxy.cs
- ICspAsymmetricAlgorithm.cs
- FileLevelControlBuilderAttribute.cs
- XmlAnyAttributeAttribute.cs
- ParagraphVisual.cs
- GridViewColumnHeaderAutomationPeer.cs
- WebPartZoneBase.cs
- TableLayoutCellPaintEventArgs.cs
- DocumentPageHost.cs
- WindowsPen.cs
- odbcmetadatacolumnnames.cs
- TriggerBase.cs
- AdornerHitTestResult.cs
- BinaryNode.cs
- InternalMappingException.cs
- Screen.cs
- ThicknessAnimation.cs
- VisualBrush.cs
- SchemaTableOptionalColumn.cs
- DayRenderEvent.cs
- ServerIdentity.cs
- HtmlInputHidden.cs
- ListBindingHelper.cs