Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / MS / Internal / PtsHost / TextFormatterHost.cs / 1 / 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) { if(textFormatter == null) { TextFormatter = TextFormatter.FromCurrentDispatcher(); } 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
- PagerStyle.cs
- Helpers.cs
- DeclarativeCatalogPart.cs
- Vector3DCollectionValueSerializer.cs
- CqlWriter.cs
- MergablePropertyAttribute.cs
- IntSecurity.cs
- MaterializeFromAtom.cs
- TraceRecord.cs
- ArrayElementGridEntry.cs
- CodeDOMUtility.cs
- BitmapDecoder.cs
- MessageDecoder.cs
- AnnotationAuthorChangedEventArgs.cs
- Polygon.cs
- PropertyPathConverter.cs
- Stack.cs
- RoutedEventHandlerInfo.cs
- SparseMemoryStream.cs
- DaylightTime.cs
- UnsafeCollabNativeMethods.cs
- NameNode.cs
- ModuleElement.cs
- Transform.cs
- MetadataStore.cs
- PromptBuilder.cs
- ListViewItemSelectionChangedEvent.cs
- XmlAttributeHolder.cs
- SchemaTableOptionalColumn.cs
- DbConnectionInternal.cs
- EffectiveValueEntry.cs
- Utilities.cs
- FixedStringLookup.cs
- SchemaImporterExtensionElement.cs
- PenCursorManager.cs
- SqlDataSourceSelectingEventArgs.cs
- recordstatefactory.cs
- Scalars.cs
- ChameleonKey.cs
- SurrogateEncoder.cs
- ObjectQueryProvider.cs
- Page.cs
- HandleTable.cs
- Geometry3D.cs
- XmlJsonWriter.cs
- WhitespaceRuleLookup.cs
- SamlSecurityToken.cs
- DataColumnCollection.cs
- ActivationArguments.cs
- MediaEntryAttribute.cs
- HandleRef.cs
- IntranetCredentialPolicy.cs
- MdiWindowListItemConverter.cs
- ViewManager.cs
- EdmRelationshipRoleAttribute.cs
- DesignerOptionService.cs
- PriorityRange.cs
- ListBoxAutomationPeer.cs
- AnyAllSearchOperator.cs
- ContainerUtilities.cs
- SqlIdentifier.cs
- TaskExceptionHolder.cs
- ObjectTypeMapping.cs
- StandardOleMarshalObject.cs
- StaticDataManager.cs
- BinaryConverter.cs
- InvokeMethod.cs
- CurrentChangedEventManager.cs
- MediaElementAutomationPeer.cs
- DbFunctionCommandTree.cs
- DbDeleteCommandTree.cs
- CacheChildrenQuery.cs
- BoundField.cs
- EventDescriptorCollection.cs
- UrlPropertyAttribute.cs
- OleTxTransaction.cs
- DbgUtil.cs
- TextEditorSelection.cs
- AppDomain.cs
- ContentFilePart.cs
- SQlBooleanStorage.cs
- DataSourceControl.cs
- CodeDomConfigurationHandler.cs
- UIElementCollection.cs
- InstanceCreationEditor.cs
- QueryStringParameter.cs
- ZoneIdentityPermission.cs
- ToolStripPanelSelectionGlyph.cs
- MetadataArtifactLoaderResource.cs
- NameHandler.cs
- VirtualizingPanel.cs
- sqlmetadatafactory.cs
- XmlSchemaInfo.cs
- ValueChangedEventManager.cs
- SiteMapDataSourceView.cs
- HttpCapabilitiesSectionHandler.cs
- WebBrowserDocumentCompletedEventHandler.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- Odbc32.cs
- SqlNodeAnnotations.cs