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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeMemberEvent.cs
- SignalGate.cs
- StrokeCollectionDefaultValueFactory.cs
- CircleHotSpot.cs
- PrimitiveXmlSerializers.cs
- ZipIOModeEnforcingStream.cs
- DiffuseMaterial.cs
- ResourceSetExpression.cs
- IntSecurity.cs
- XmlIncludeAttribute.cs
- ScriptingRoleServiceSection.cs
- DocumentsTrace.cs
- ToolStripTemplateNode.cs
- AssociationSetEnd.cs
- CodeStatement.cs
- HasCopySemanticsAttribute.cs
- DelegatingChannelListener.cs
- PointHitTestResult.cs
- EqualityComparer.cs
- CodeEntryPointMethod.cs
- DbConnectionPoolCounters.cs
- remotingproxy.cs
- StateWorkerRequest.cs
- RegexCode.cs
- SecurityContextTokenValidationException.cs
- ClientData.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- MimePart.cs
- ImpersonationContext.cs
- XamlReaderHelper.cs
- PathSegmentCollection.cs
- MdImport.cs
- Int32CAMarshaler.cs
- PropertyPathConverter.cs
- PackWebRequestFactory.cs
- DataControlButton.cs
- GetPageCompletedEventArgs.cs
- MessageQueueInstaller.cs
- RenderData.cs
- DataTemplate.cs
- RtfToXamlReader.cs
- BufferedReceiveElement.cs
- COAUTHIDENTITY.cs
- WebPartConnectionsDisconnectVerb.cs
- HttpConfigurationContext.cs
- CodePageUtils.cs
- ObjectCacheSettings.cs
- ContentDisposition.cs
- ClientSettings.cs
- XmlTextReaderImplHelpers.cs
- CultureNotFoundException.cs
- SignedXml.cs
- ReferencedAssembly.cs
- RefreshEventArgs.cs
- ExpressionNormalizer.cs
- ProcessHostMapPath.cs
- SqlRewriteScalarSubqueries.cs
- HuffmanTree.cs
- ConnectionsZone.cs
- M3DUtil.cs
- BaseParaClient.cs
- DataGridCellItemAutomationPeer.cs
- ValueSerializer.cs
- CompositeKey.cs
- XNodeNavigator.cs
- SubclassTypeValidatorAttribute.cs
- BinaryMethodMessage.cs
- StyleSheet.cs
- RC2.cs
- VBCodeProvider.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- MimeWriter.cs
- DataGridViewRowHeaderCell.cs
- BindingParameterCollection.cs
- TableChangeProcessor.cs
- ErrorStyle.cs
- ErrorHandlingReceiver.cs
- GridItemPatternIdentifiers.cs
- PackageController.cs
- FontUnit.cs
- CompilationUnit.cs
- PageThemeParser.cs
- XmlUnspecifiedAttribute.cs
- NumericExpr.cs
- DataPointer.cs
- DateTimeConverter.cs
- TaskDesigner.cs
- KeyFrames.cs
- TailPinnedEventArgs.cs
- IERequestCache.cs
- WindowsMenu.cs
- X509SecurityTokenAuthenticator.cs
- WorkItem.cs
- InvalidDataContractException.cs
- GetImportedCardRequest.cs
- RequestSecurityTokenResponse.cs
- GlobalizationAssembly.cs
- HttpCapabilitiesBase.cs
- WindowsAuthenticationModule.cs
- Effect.cs