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
- HttpWebRequestElement.cs
- EntityConnectionStringBuilderItem.cs
- URIFormatException.cs
- DirectionalLight.cs
- Range.cs
- StructuredTypeEmitter.cs
- ScopedKnownTypes.cs
- Invariant.cs
- SqlConnectionStringBuilder.cs
- NullableFloatMinMaxAggregationOperator.cs
- SizeAnimation.cs
- AssemblyUtil.cs
- localization.cs
- PrintDocument.cs
- TableLayoutColumnStyleCollection.cs
- ToolStripItemCollection.cs
- OutKeywords.cs
- XmlTextReader.cs
- AttachedPropertiesService.cs
- EncryptedData.cs
- DataGridSortCommandEventArgs.cs
- GACIdentityPermission.cs
- StaticFileHandler.cs
- SqlPersonalizationProvider.cs
- Triplet.cs
- EtwTrace.cs
- SoapServerMethod.cs
- TransformationRules.cs
- XmlSchemaAll.cs
- InvalidWMPVersionException.cs
- ScriptingRoleServiceSection.cs
- ComponentRenameEvent.cs
- WorkflowServiceHost.cs
- WebPartEditorApplyVerb.cs
- CapabilitiesAssignment.cs
- CapabilitiesRule.cs
- FontUnitConverter.cs
- XmlWriter.cs
- ErrorRuntimeConfig.cs
- MatrixKeyFrameCollection.cs
- PropertyOverridesTypeEditor.cs
- Column.cs
- FullTrustAssembly.cs
- ReferencedAssemblyResolver.cs
- TranslateTransform3D.cs
- DependencyObjectPropertyDescriptor.cs
- GACIdentityPermission.cs
- DetailsViewInsertEventArgs.cs
- Property.cs
- ConfigXmlElement.cs
- SectionInformation.cs
- AppModelKnownContentFactory.cs
- GestureRecognitionResult.cs
- InputLangChangeEvent.cs
- Expression.cs
- _ServiceNameStore.cs
- UDPClient.cs
- IssuanceLicense.cs
- AffineTransform3D.cs
- InheritanceRules.cs
- SqlCommand.cs
- FreezableDefaultValueFactory.cs
- ColumnResizeUndoUnit.cs
- TextViewDesigner.cs
- SymbolMethod.cs
- StringDictionary.cs
- ToolStripProgressBar.cs
- LinqDataSourceContextEventArgs.cs
- Crypto.cs
- AdornerHitTestResult.cs
- ScalarRestriction.cs
- SchemaMapping.cs
- SymLanguageVendor.cs
- CdpEqualityComparer.cs
- KeyEventArgs.cs
- DNS.cs
- StructuralCache.cs
- InvalidComObjectException.cs
- WeakEventTable.cs
- PngBitmapDecoder.cs
- SlotInfo.cs
- ChannelSinkStacks.cs
- ProcessingInstructionAction.cs
- StringWriter.cs
- ComponentEvent.cs
- QueryHandler.cs
- SubMenuStyle.cs
- GcSettings.cs
- AssemblyResourceLoader.cs
- BypassElementCollection.cs
- QilExpression.cs
- WindowsScrollBarBits.cs
- TemplateBamlTreeBuilder.cs
- TabControlCancelEvent.cs
- MarginsConverter.cs
- CodeObject.cs
- SchemaImporterExtension.cs
- CompilationPass2Task.cs
- FillBehavior.cs
- RegexCode.cs