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
- BitHelper.cs
- Int64.cs
- Code.cs
- SqlDataSourceView.cs
- SpotLight.cs
- WinEventWrap.cs
- CodeSubDirectoriesCollection.cs
- IPAddressCollection.cs
- ExpressionBindingCollection.cs
- OdbcReferenceCollection.cs
- Validator.cs
- StringReader.cs
- OptionUsage.cs
- MsdtcWrapper.cs
- OleDbTransaction.cs
- ImageCodecInfo.cs
- TagMapInfo.cs
- BehaviorEditorPart.cs
- TreeViewItemAutomationPeer.cs
- AddInAttribute.cs
- LoadRetryHandler.cs
- TreeView.cs
- Root.cs
- RefreshEventArgs.cs
- Point.cs
- SecurityManager.cs
- ViewCellSlot.cs
- SpeechRecognitionEngine.cs
- HScrollBar.cs
- Command.cs
- QueryAsyncResult.cs
- PropertyConverter.cs
- UrlEncodedParameterWriter.cs
- ValuePatternIdentifiers.cs
- TreeNodeEventArgs.cs
- DockingAttribute.cs
- ReceiveSecurityHeaderEntry.cs
- CanExecuteRoutedEventArgs.cs
- PersistenceTypeAttribute.cs
- XmlElementAttribute.cs
- GroupBox.cs
- WebPartDisplayModeCancelEventArgs.cs
- WebPartEventArgs.cs
- KnownTypesHelper.cs
- CodeNamespaceImport.cs
- XmlTextAttribute.cs
- TimersDescriptionAttribute.cs
- HttpWebResponse.cs
- VisualBrush.cs
- FormatException.cs
- OleDbErrorCollection.cs
- WorkflowItemPresenter.cs
- DoubleKeyFrameCollection.cs
- CheckBox.cs
- TdsParserHelperClasses.cs
- Int64Converter.cs
- SemaphoreSlim.cs
- AuthenticationModuleElementCollection.cs
- Converter.cs
- WsiProfilesElementCollection.cs
- MarkupWriter.cs
- SimpleRecyclingCache.cs
- FontUnit.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ValueExpressions.cs
- ConnectionPointConverter.cs
- DispatchWrapper.cs
- DrawingCollection.cs
- invalidudtexception.cs
- SqlCacheDependencyDatabaseCollection.cs
- GroupItemAutomationPeer.cs
- ProvideValueServiceProvider.cs
- InternalDispatchObject.cs
- DrawingContextWalker.cs
- XmlStringTable.cs
- DataPagerField.cs
- XPathDocumentIterator.cs
- CancellationTokenSource.cs
- BitSet.cs
- ListParaClient.cs
- CodeExpressionStatement.cs
- BaseCodePageEncoding.cs
- MsmqSecureHashAlgorithm.cs
- HostingEnvironmentWrapper.cs
- SamlAttribute.cs
- ToolStripSystemRenderer.cs
- QuadraticBezierSegment.cs
- SchemaReference.cs
- PrintDialog.cs
- MenuItem.cs
- LayoutEvent.cs
- DateTimeFormatInfo.cs
- CompositeControl.cs
- _NTAuthentication.cs
- __Error.cs
- ButtonBaseAdapter.cs
- X509WindowsSecurityToken.cs
- ContentFileHelper.cs
- ParameterCollection.cs
- AnnotationComponentChooser.cs