Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Emitter.cs
- MouseCaptureWithinProperty.cs
- VirtualizedContainerService.cs
- DbConnectionFactory.cs
- PathGradientBrush.cs
- AvTraceDetails.cs
- FixedTextBuilder.cs
- ObjectDataSourceStatusEventArgs.cs
- ResetableIterator.cs
- MergablePropertyAttribute.cs
- Command.cs
- AttributeCollection.cs
- SmtpFailedRecipientsException.cs
- AdditionalEntityFunctions.cs
- ActivityDesigner.cs
- DispatcherTimer.cs
- AssemblyBuilder.cs
- SetState.cs
- HebrewNumber.cs
- SamlAction.cs
- DbConnectionPoolIdentity.cs
- NotSupportedException.cs
- XpsS0ValidatingLoader.cs
- FormViewModeEventArgs.cs
- MulticastIPAddressInformationCollection.cs
- TabControl.cs
- RangeValidator.cs
- Int64AnimationBase.cs
- HttpConfigurationSystem.cs
- KeyedCollection.cs
- BrowserDefinitionCollection.cs
- EventProxy.cs
- TabItem.cs
- CompressedStack.cs
- TextContainerChangeEventArgs.cs
- CodeAttachEventStatement.cs
- COM2PropertyDescriptor.cs
- WeakReference.cs
- QueryCacheKey.cs
- WebControl.cs
- RemotingConfiguration.cs
- webclient.cs
- HelpKeywordAttribute.cs
- ConfigXmlElement.cs
- TextDecorationUnitValidation.cs
- FileSecurity.cs
- WindowsTokenRoleProvider.cs
- Array.cs
- TreeViewBindingsEditor.cs
- MarkupWriter.cs
- RSACryptoServiceProvider.cs
- CollectionBuilder.cs
- InfoCardArgumentException.cs
- ImmComposition.cs
- XmlSerializerFormatAttribute.cs
- TableCellCollection.cs
- VectorAnimationBase.cs
- AttributeTable.cs
- DataGridViewColumn.cs
- HttpResponse.cs
- DataGridTable.cs
- ConstraintConverter.cs
- ListViewGroupItemCollection.cs
- EventDrivenDesigner.cs
- ScrollPatternIdentifiers.cs
- TextDocumentView.cs
- WeakReadOnlyCollection.cs
- FileDialog.cs
- ToolStripDropDownClosingEventArgs.cs
- SegmentInfo.cs
- WebPartCloseVerb.cs
- LocalBuilder.cs
- RectAnimation.cs
- MethodImplAttribute.cs
- DataServiceConfiguration.cs
- BitmapEffect.cs
- HttpConfigurationContext.cs
- FixedSOMElement.cs
- RequiredFieldValidator.cs
- BindingCompleteEventArgs.cs
- TagNameToTypeMapper.cs
- TraceUtils.cs
- TableItemStyle.cs
- CodePropertyReferenceExpression.cs
- StretchValidation.cs
- InputManager.cs
- StylusPoint.cs
- AsnEncodedData.cs
- QueryContinueDragEventArgs.cs
- XmlEventCache.cs
- dbenumerator.cs
- SchemaElement.cs
- DataGridViewColumnConverter.cs
- ObjectCloneHelper.cs
- SystemInfo.cs
- DragStartedEventArgs.cs
- WebReferenceCollection.cs
- AnimationLayer.cs
- SQLRoleProvider.cs
- StreamSecurityUpgradeInitiatorBase.cs