Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / PtsHost / TextFormatterHost.cs / 1305600 / TextFormatterHost.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: ContainerParagraph.cs // // Description: TextFormatter host. // // History: // 05/05/2003 : [....] - moving from Avalon branch. // //--------------------------------------------------------------------------- using System; using System.Diagnostics; using System.Windows; using System.Windows.Media; using System.Windows.Media.TextFormatting; namespace MS.Internal.PtsHost { // --------------------------------------------------------------------- // TextFormatter host. // --------------------------------------------------------------------- internal sealed class TextFormatterHost : TextSource { internal TextFormatterHost(TextFormatter textFormatter, TextFormattingMode textFormattingMode) { if(textFormatter == null) { TextFormatter = TextFormatter.FromCurrentDispatcher(textFormattingMode); } else { TextFormatter = textFormatter; } } //-------------------------------------------------------------------- // GetTextRun //------------------------------------------------------------------- public override TextRun GetTextRun(int textSourceCharacterIndex) { Debug.Assert(Context != null, "TextFormatter host is not initialized."); Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); return Context.GetTextRun(textSourceCharacterIndex); } //-------------------------------------------------------------------- // GetPrecedingText //-------------------------------------------------------------------- public override TextSpanGetPrecedingText(int textSourceCharacterIndexLimit) { Debug.Assert(Context != null, "TextFormatter host is not initialized."); Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); return Context.GetPrecedingText(textSourceCharacterIndexLimit); } /// /// TextFormatter to map a text source character index to a text effect character index /// /// text source character index ///the text effect index corresponding to the text effect character index public override int GetTextEffectCharacterIndexFromTextSourceCharacterIndex( int textSourceCharacterIndex ) { Debug.Assert(Context != null, "TextFormatter host is not initialized."); Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative."); return Context.GetTextEffectCharacterIndexFromTextSourceCharacterIndex(textSourceCharacterIndex); } //------------------------------------------------------------------- // TextFormatterHost context, object responsible for providing // formatting information. //-------------------------------------------------------------------- internal LineBase Context; //------------------------------------------------------------------- // TextFormatter. //------------------------------------------------------------------- internal TextFormatter TextFormatter; } } // 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
- MemberInfoSerializationHolder.cs
- OleDbWrapper.cs
- ClientConvert.cs
- XmlNodeChangedEventManager.cs
- EmbeddedObject.cs
- HScrollBar.cs
- CodeStatementCollection.cs
- XmlLanguage.cs
- SqlFunctionAttribute.cs
- DataGridViewImageCell.cs
- WorkflowMarkupSerializer.cs
- SystemWebExtensionsSectionGroup.cs
- MetaChildrenColumn.cs
- DateTimeFormat.cs
- PointLight.cs
- RepeatButton.cs
- ProfileService.cs
- RemoteWebConfigurationHostStream.cs
- DataGridViewButtonCell.cs
- RequestCacheManager.cs
- PreDigestedSignedInfo.cs
- QueueProcessor.cs
- TextFormatterImp.cs
- StringArrayEditor.cs
- PersistChildrenAttribute.cs
- CompositeActivityTypeDescriptorProvider.cs
- UdpRetransmissionSettings.cs
- Italic.cs
- GuidelineCollection.cs
- ImageMetadata.cs
- BufferedWebEventProvider.cs
- ParserOptions.cs
- HttpBrowserCapabilitiesBase.cs
- RealizationContext.cs
- SynchronizedInputHelper.cs
- IdentitySection.cs
- ComponentSerializationService.cs
- ModelUIElement3D.cs
- _AutoWebProxyScriptEngine.cs
- BrushValueSerializer.cs
- TreeNodeCollection.cs
- ImportedPolicyConversionContext.cs
- SymbolPair.cs
- SimpleTypesSurrogate.cs
- FieldBuilder.cs
- Int32Converter.cs
- PhysicalFontFamily.cs
- DataViewSetting.cs
- DrawListViewColumnHeaderEventArgs.cs
- UIElementParaClient.cs
- ThicknessAnimation.cs
- WindowProviderWrapper.cs
- LocatorBase.cs
- MetabaseSettingsIis7.cs
- EntityEntry.cs
- LocatorManager.cs
- XPathPatternParser.cs
- ThicknessAnimation.cs
- ClassHandlersStore.cs
- ContextInformation.cs
- PageRequestManager.cs
- MemberHolder.cs
- columnmapfactory.cs
- PerformanceCounterPermission.cs
- FormViewUpdatedEventArgs.cs
- _Rfc2616CacheValidators.cs
- EventSinkHelperWriter.cs
- DesignerActionUIService.cs
- TrackingMemoryStreamFactory.cs
- FontUnitConverter.cs
- TypeElementCollection.cs
- SQLBoolean.cs
- XPathParser.cs
- SqlWebEventProvider.cs
- DataGridViewRowsAddedEventArgs.cs
- DataGridHeaderBorder.cs
- Wizard.cs
- XmlMessageFormatter.cs
- JournalNavigationScope.cs
- DataGridViewHitTestInfo.cs
- CryptoApi.cs
- AspNetHostingPermission.cs
- MarshalDirectiveException.cs
- KeyGesture.cs
- DispatcherHookEventArgs.cs
- OutputScope.cs
- SqlRowUpdatedEvent.cs
- RulePatternOps.cs
- CellCreator.cs
- AuthenticationConfig.cs
- InstanceHandleConflictException.cs
- RuntimeHandles.cs
- InputQueueChannelAcceptor.cs
- NativeCompoundFileAPIs.cs
- SQLInt64.cs
- DialogResultConverter.cs
- RegisteredDisposeScript.cs
- SHA512.cs
- CodeDomLoader.cs
- ClientScriptManager.cs