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
- CommonDialog.cs
- GetReadStreamResult.cs
- CalendarDay.cs
- HeaderedContentControl.cs
- SessionPageStatePersister.cs
- TargetParameterCountException.cs
- FloatMinMaxAggregationOperator.cs
- RSAProtectedConfigurationProvider.cs
- ReachFixedDocumentSerializer.cs
- RadioButton.cs
- TypeInitializationException.cs
- FileDetails.cs
- KeyedCollection.cs
- PreviewPageInfo.cs
- ClosableStream.cs
- SystemThemeKey.cs
- CompilerTypeWithParams.cs
- PackageRelationship.cs
- BitmapEffectDrawing.cs
- WindowsClientElement.cs
- WeakEventTable.cs
- ZipArchive.cs
- CodeTypeDeclaration.cs
- SerializationInfoEnumerator.cs
- PassportAuthentication.cs
- AppDomain.cs
- OleDbParameterCollection.cs
- ProfileModule.cs
- ProcessHost.cs
- ZoneMembershipCondition.cs
- OdbcParameter.cs
- ObjectConverter.cs
- ExpressionEditor.cs
- FileDetails.cs
- XmlSchemaComplexContent.cs
- XmlAttributeProperties.cs
- ObjectDataSourceView.cs
- BulletChrome.cs
- PeekCompletedEventArgs.cs
- QualificationDataAttribute.cs
- WebOperationContext.cs
- LinkClickEvent.cs
- Pen.cs
- DrawingContextDrawingContextWalker.cs
- SvcFileManager.cs
- ZipPackagePart.cs
- ProfileManager.cs
- PrintSystemException.cs
- TTSEngineTypes.cs
- SchemaAttDef.cs
- AutomationEvent.cs
- WebDisplayNameAttribute.cs
- ResolveDuplexAsyncResult.cs
- FloaterParagraph.cs
- ResourceAssociationType.cs
- ClientConfigurationHost.cs
- UnlockInstanceCommand.cs
- SignatureHelper.cs
- UriParserTemplates.cs
- SafeSecurityHandles.cs
- ComponentFactoryHelpers.cs
- XmlDataSourceNodeDescriptor.cs
- ResolveMatchesMessage11.cs
- CompilerErrorCollection.cs
- Funcletizer.cs
- SrgsGrammarCompiler.cs
- TemplateBindingExtension.cs
- TargetFrameworkAttribute.cs
- FacetValueContainer.cs
- BaseCAMarshaler.cs
- InvalidCastException.cs
- StringExpressionSet.cs
- CuspData.cs
- UnsafeNativeMethods.cs
- AttributeCollection.cs
- AxisAngleRotation3D.cs
- PageCatalogPart.cs
- EventMemberCodeDomSerializer.cs
- SocketAddress.cs
- UIElement3D.cs
- SimpleColumnProvider.cs
- ServiceDiscoveryElement.cs
- RoleManagerSection.cs
- Internal.cs
- Double.cs
- GroupLabel.cs
- DataGridAddNewRow.cs
- ActivityExecutionContextCollection.cs
- IsolationInterop.cs
- InputScopeConverter.cs
- ClientTargetCollection.cs
- UnmanagedMarshal.cs
- SendReply.cs
- WorkflowTransactionService.cs
- MsmqBindingElementBase.cs
- SiteMap.cs
- ClassImporter.cs
- InProcStateClientManager.cs
- BrushMappingModeValidation.cs
- WinInetCache.cs