Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SynchronizedDispatch.cs
- HttpContextWrapper.cs
- TableRowGroup.cs
- MSAAEventDispatcher.cs
- RenamedEventArgs.cs
- CompiledAction.cs
- PasswordRecovery.cs
- SymLanguageVendor.cs
- FormViewUpdatedEventArgs.cs
- HttpSocketManager.cs
- _HelperAsyncResults.cs
- SafeEventLogWriteHandle.cs
- LoginNameDesigner.cs
- SoapReflectionImporter.cs
- SqlTopReducer.cs
- Clause.cs
- XPSSignatureDefinition.cs
- MethodCallConverter.cs
- GenericEnumerator.cs
- XmlDeclaration.cs
- CryptoConfig.cs
- LineServices.cs
- HashCodeCombiner.cs
- ProcessManager.cs
- DataColumnMapping.cs
- PeerInputChannelListener.cs
- FileUpload.cs
- SequenceDesigner.xaml.cs
- FrameworkContextData.cs
- ContentDisposition.cs
- ExecutionEngineException.cs
- ButtonChrome.cs
- DocumentGridPage.cs
- StorageTypeMapping.cs
- WebControlToolBoxItem.cs
- CultureSpecificCharacterBufferRange.cs
- ConfigurationElementProperty.cs
- IdnElement.cs
- DashStyle.cs
- SamlAssertionKeyIdentifierClause.cs
- SqlUtils.cs
- StylusCaptureWithinProperty.cs
- ActiveDocumentEvent.cs
- CqlBlock.cs
- StyleSelector.cs
- PrintDocument.cs
- SQLBytes.cs
- DeviceSpecificChoice.cs
- XmlSchemaRedefine.cs
- InteropBitmapSource.cs
- XmlSerializationGeneratedCode.cs
- Crc32.cs
- EntityDataSourceEntitySetNameItem.cs
- IdentitySection.cs
- XPathAxisIterator.cs
- UnsafeNetInfoNativeMethods.cs
- BaseTemplateBuildProvider.cs
- TextPointerBase.cs
- DefaultTextStore.cs
- DataComponentGenerator.cs
- RadioButtonDesigner.cs
- ServerValidateEventArgs.cs
- SelectionPattern.cs
- LineBreak.cs
- InheritablePropertyChangeInfo.cs
- LogEntryHeaderDeserializer.cs
- OdbcErrorCollection.cs
- BrushValueSerializer.cs
- PenContexts.cs
- SQLResource.cs
- Setter.cs
- SettingsBindableAttribute.cs
- InboundActivityHelper.cs
- BrowserInteropHelper.cs
- TextTreeRootTextBlock.cs
- DataServiceContext.cs
- DataPagerFieldCollection.cs
- BindingManagerDataErrorEventArgs.cs
- XamlInt32CollectionSerializer.cs
- ReflectionUtil.cs
- AssemblyHash.cs
- DecimalAnimationBase.cs
- Rfc4050KeyFormatter.cs
- TextEditorTables.cs
- BaseDataList.cs
- HttpWrapper.cs
- UInt16.cs
- ResolveCriteriaApril2005.cs
- HandlerMappingMemo.cs
- TextElementEnumerator.cs
- Pair.cs
- EntitySqlQueryState.cs
- BrowsableAttribute.cs
- BasicCellRelation.cs
- HandlerElement.cs
- XDeferredAxisSource.cs
- EntityModelBuildProvider.cs
- WinFormsSpinner.cs
- KnownTypeHelper.cs
- RegularExpressionValidator.cs