Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / textformatting / TextRunCache.cs / 1305600 / 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
- VirtualStackFrame.cs
- PageTheme.cs
- AmbientEnvironment.cs
- PackageRelationshipCollection.cs
- ThreadStartException.cs
- PolicyManager.cs
- DesignerActionList.cs
- GZipDecoder.cs
- SmiRequestExecutor.cs
- ChannelManager.cs
- XmlSchemaRedefine.cs
- PolyLineSegment.cs
- DataBindingsDialog.cs
- SecurityAppliedMessage.cs
- safesecurityhelperavalon.cs
- SqlSelectStatement.cs
- ServerIdentity.cs
- SessionPageStateSection.cs
- RijndaelManagedTransform.cs
- IsolatedStorageFileStream.cs
- ThreadInterruptedException.cs
- VersionPair.cs
- TextParagraphView.cs
- BuildManager.cs
- XmlNullResolver.cs
- DataControlFieldCollection.cs
- MetadataPropertyCollection.cs
- CorrelationManager.cs
- SQLMoney.cs
- Faults.cs
- EdmMember.cs
- DrawingDrawingContext.cs
- WebPartEditorCancelVerb.cs
- SupportsEventValidationAttribute.cs
- ClickablePoint.cs
- EntityDataSourceEntitySetNameItem.cs
- BamlBinaryReader.cs
- FixedElement.cs
- Int16AnimationUsingKeyFrames.cs
- DeferredReference.cs
- CodeDefaultValueExpression.cs
- BasicKeyConstraint.cs
- CmsInterop.cs
- XmlBoundElement.cs
- CodeExpressionCollection.cs
- ServerValidateEventArgs.cs
- altserialization.cs
- AttachmentCollection.cs
- Material.cs
- EnumMemberAttribute.cs
- RadioButtonRenderer.cs
- ProfileGroupSettingsCollection.cs
- XmlDictionaryString.cs
- COMException.cs
- ListInitExpression.cs
- XPathNodeHelper.cs
- EdmPropertyAttribute.cs
- EncryptedXml.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- BrowserCapabilitiesCodeGenerator.cs
- TableLayoutPanelResizeGlyph.cs
- GridViewEditEventArgs.cs
- LabelLiteral.cs
- TrustSection.cs
- TextProperties.cs
- HwndTarget.cs
- JpegBitmapEncoder.cs
- NativeWrapper.cs
- Single.cs
- ResolveCriteria11.cs
- XmlSerializerAssemblyAttribute.cs
- DesignerView.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- WsatServiceAddress.cs
- GradientStop.cs
- KeysConverter.cs
- Location.cs
- AutomationPatternInfo.cs
- OleDbTransaction.cs
- RsaElement.cs
- FontUnitConverter.cs
- UnitySerializationHolder.cs
- Int32Rect.cs
- XPathScanner.cs
- ListManagerBindingsCollection.cs
- InternalRelationshipCollection.cs
- KeyConverter.cs
- NonSerializedAttribute.cs
- RightsManagementPermission.cs
- HandlerWithFactory.cs
- Merger.cs
- ToolStripDropDownMenu.cs
- OrderByBuilder.cs
- DictionaryEntry.cs
- BitmapDownload.cs
- ModelTreeEnumerator.cs
- TypedElement.cs
- TimerElapsedEvenArgs.cs
- SymDocumentType.cs
- PostBackOptions.cs