Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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: [....]/sites/Avalon/Specs/Text%20Formatting%20API.doc // // Created: 2-25-2003 [....] ([....]) // //----------------------------------------------------------------------- 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
- WhiteSpaceTrimStringConverter.cs
- ObjectFullSpanRewriter.cs
- DataGridTablesFactory.cs
- PeerApplicationLaunchInfo.cs
- Rijndael.cs
- ValidatorCompatibilityHelper.cs
- DataObjectEventArgs.cs
- Pkcs9Attribute.cs
- ChtmlPhoneCallAdapter.cs
- Imaging.cs
- RelOps.cs
- HierarchicalDataSourceIDConverter.cs
- NativeMethods.cs
- GridViewRowEventArgs.cs
- BehaviorEditorPart.cs
- DBBindings.cs
- CodeBinaryOperatorExpression.cs
- DataSourceListEditor.cs
- ConnectionStringsExpressionBuilder.cs
- DataGridViewHitTestInfo.cs
- TextAction.cs
- ItemsChangedEventArgs.cs
- UnitySerializationHolder.cs
- GiveFeedbackEventArgs.cs
- XPathDocumentNavigator.cs
- FormatException.cs
- PlainXmlDeserializer.cs
- CodeNamespaceImportCollection.cs
- HwndSource.cs
- PeerApplication.cs
- HeaderCollection.cs
- IChannel.cs
- CalendarTable.cs
- KeyInfo.cs
- SoapWriter.cs
- PersianCalendar.cs
- EntitySqlQueryCacheEntry.cs
- EntityTemplateUserControl.cs
- XmlCustomFormatter.cs
- TraceLog.cs
- ListViewItemMouseHoverEvent.cs
- TypeExtensionConverter.cs
- SmiConnection.cs
- XmlTypeAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- CornerRadius.cs
- MailAddress.cs
- OdbcConnectionHandle.cs
- WsdlBuildProvider.cs
- DataStorage.cs
- Registry.cs
- DocumentXmlWriter.cs
- MdImport.cs
- HttpBindingExtension.cs
- StatusBar.cs
- iisPickupDirectory.cs
- DataSourceConverter.cs
- EntityDataReader.cs
- TableItemPattern.cs
- fixedPageContentExtractor.cs
- DeviceSpecific.cs
- EntitySqlQueryBuilder.cs
- DispatcherObject.cs
- ListViewUpdatedEventArgs.cs
- HyperLinkStyle.cs
- Repeater.cs
- TextUtf8RawTextWriter.cs
- SerializationInfo.cs
- Encoding.cs
- BevelBitmapEffect.cs
- NameValuePair.cs
- BackgroundWorker.cs
- TransformDescriptor.cs
- assertwrapper.cs
- KeyGesture.cs
- SqlNodeAnnotation.cs
- DataContract.cs
- TextParagraphCache.cs
- UseLicense.cs
- CodeTypeDelegate.cs
- TableRowCollection.cs
- XhtmlBasicImageAdapter.cs
- EntityDataSourceUtil.cs
- ModelEditingScope.cs
- OdbcErrorCollection.cs
- FtpWebResponse.cs
- GridViewHeaderRowPresenter.cs
- printdlgexmarshaler.cs
- OpenTypeLayoutCache.cs
- SiblingIterators.cs
- RC2.cs
- HashCodeCombiner.cs
- MetadataItemCollectionFactory.cs
- FontResourceCache.cs
- CultureInfo.cs
- ConfigurationSchemaErrors.cs
- TextDataBindingHandler.cs
- WebControlAdapter.cs
- PermissionAttributes.cs
- CalendarDay.cs