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
- GridViewPageEventArgs.cs
- SuppressMessageAttribute.cs
- SimpleWebHandlerParser.cs
- Point.cs
- FieldInfo.cs
- DbConnectionStringCommon.cs
- DbConnectionPoolOptions.cs
- DependencyProperty.cs
- ServiceSecurityContext.cs
- Keyboard.cs
- LinqDataSourceEditData.cs
- CheckBox.cs
- SpeechSynthesizer.cs
- LoginCancelEventArgs.cs
- Brushes.cs
- ResolveNameEventArgs.cs
- SimpleParser.cs
- GcSettings.cs
- XmlSchemaSequence.cs
- XmlLanguage.cs
- SystemIPInterfaceProperties.cs
- CmsInterop.cs
- CodeExporter.cs
- Compiler.cs
- SHA384.cs
- SqlServer2KCompatibilityCheck.cs
- PriorityBinding.cs
- BaseResourcesBuildProvider.cs
- DataViewSetting.cs
- CopyEncoder.cs
- TransformCollection.cs
- oledbmetadatacollectionnames.cs
- activationcontext.cs
- XPathSelectionIterator.cs
- ConfigurationManagerHelperFactory.cs
- Attachment.cs
- FacetDescriptionElement.cs
- SqlDataRecord.cs
- FormView.cs
- bindurihelper.cs
- CompilerErrorCollection.cs
- _LocalDataStore.cs
- ISessionStateStore.cs
- TabRenderer.cs
- CompilerScope.Storage.cs
- UntypedNullExpression.cs
- RectangleGeometry.cs
- XmlTextWriter.cs
- MultipleViewProviderWrapper.cs
- NamespaceTable.cs
- DataObjectFieldAttribute.cs
- SqlParameterCollection.cs
- ContentTextAutomationPeer.cs
- Drawing.cs
- XmlQueryRuntime.cs
- MergePropertyDescriptor.cs
- EventEntry.cs
- RequestContext.cs
- WebPartsPersonalization.cs
- Encoder.cs
- XmlRootAttribute.cs
- DecoderBestFitFallback.cs
- SerializationException.cs
- TextSpan.cs
- StrongNameKeyPair.cs
- XmlQualifiedName.cs
- TextDocumentView.cs
- GeneratedCodeAttribute.cs
- Label.cs
- AutomationEventArgs.cs
- QilNode.cs
- ReferenceConverter.cs
- DockEditor.cs
- WhitespaceRuleLookup.cs
- SQLInt32Storage.cs
- FixedSOMPageConstructor.cs
- EncoderParameter.cs
- EntityContainerEntitySet.cs
- SafeArrayTypeMismatchException.cs
- Page.cs
- propertytag.cs
- Matrix.cs
- XamlBrushSerializer.cs
- DeferrableContent.cs
- D3DImage.cs
- TraceEventCache.cs
- NativeMethods.cs
- PartialTrustVisibleAssemblyCollection.cs
- DataGridViewColumnConverter.cs
- RestHandler.cs
- ModuleBuilderData.cs
- LocationUpdates.cs
- ListDictionary.cs
- MetadataHelper.cs
- NativeCompoundFileAPIs.cs
- FileDataSource.cs
- Vars.cs
- ProviderSettings.cs
- WebUtil.cs
- TdsParserHelperClasses.cs