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
- CodeCommentStatement.cs
- ListBox.cs
- DrawingContext.cs
- WindowsTreeView.cs
- PolicyException.cs
- WebPartCatalogCloseVerb.cs
- RegexGroup.cs
- XmlChildEnumerator.cs
- Column.cs
- CheckBoxPopupAdapter.cs
- CookieParameter.cs
- FtpRequestCacheValidator.cs
- UInt16Storage.cs
- CanonicalizationDriver.cs
- CriticalFinalizerObject.cs
- SoapObjectReader.cs
- NetSectionGroup.cs
- CompressStream.cs
- LassoHelper.cs
- DataGridLinkButton.cs
- MouseActionConverter.cs
- CodeConditionStatement.cs
- ClientSettingsProvider.cs
- Quack.cs
- DataSourceSelectArguments.cs
- TextAnchor.cs
- DataGridViewCheckBoxColumn.cs
- DataBindEngine.cs
- AbandonedMutexException.cs
- QilValidationVisitor.cs
- TransformDescriptor.cs
- PartialList.cs
- Adorner.cs
- MappingItemCollection.cs
- JapaneseCalendar.cs
- _NegoState.cs
- DuplexSecurityProtocolFactory.cs
- NullReferenceException.cs
- SocketException.cs
- SudsParser.cs
- InstanceNotReadyException.cs
- KeySpline.cs
- MemberRestriction.cs
- ImportedPolicyConversionContext.cs
- ValidationHelper.cs
- RichTextBoxConstants.cs
- HttpClientCertificate.cs
- OrderedDictionary.cs
- dataprotectionpermissionattribute.cs
- XmlMapping.cs
- SqlReorderer.cs
- DataGridViewImageCell.cs
- DispatcherTimer.cs
- SelectionRangeConverter.cs
- errorpatternmatcher.cs
- DataGridViewCellStyleChangedEventArgs.cs
- MetadataAssemblyHelper.cs
- ValidationPropertyAttribute.cs
- ActivityCodeDomSerializer.cs
- TraceListeners.cs
- EnumMember.cs
- ScheduleChanges.cs
- SecurityTokenTypes.cs
- Addressing.cs
- BuildManagerHost.cs
- InvalidComObjectException.cs
- RangeValueProviderWrapper.cs
- ComplexPropertyEntry.cs
- PrintPreviewDialog.cs
- Span.cs
- LabelAutomationPeer.cs
- ExpandSegmentCollection.cs
- TraceRecord.cs
- Collection.cs
- DbProviderFactories.cs
- SettingsPropertyCollection.cs
- XmlParserContext.cs
- ObjectDataSourceFilteringEventArgs.cs
- RowToFieldTransformer.cs
- UIElement3DAutomationPeer.cs
- TabControlCancelEvent.cs
- Variant.cs
- DropTarget.cs
- OrderPreservingSpoolingTask.cs
- SessionStateUtil.cs
- SplitterCancelEvent.cs
- ModelItemImpl.cs
- ToolStripItemDataObject.cs
- JsonUriDataContract.cs
- _DigestClient.cs
- FacetChecker.cs
- ComplexBindingPropertiesAttribute.cs
- WebPartUtil.cs
- ConnectAlgorithms.cs
- LayoutEngine.cs
- TrustLevelCollection.cs
- GroupBoxRenderer.cs
- FixedMaxHeap.cs
- ResourcePermissionBaseEntry.cs
- QueryCacheManager.cs