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
- shaperfactory.cs
- ResourceManager.cs
- SafeFileMappingHandle.cs
- UInt16Storage.cs
- ServiceChannelProxy.cs
- COM2PropertyDescriptor.cs
- XNodeNavigator.cs
- Privilege.cs
- Cursor.cs
- DataObject.cs
- ProcessModelInfo.cs
- GroupBoxDesigner.cs
- AccessText.cs
- FixedDocumentSequencePaginator.cs
- Int32Storage.cs
- SQLBytesStorage.cs
- WorkflowViewService.cs
- SystemInfo.cs
- MediaElementAutomationPeer.cs
- PictureBox.cs
- LayoutEditorPart.cs
- Size.cs
- DesignerHelpers.cs
- ConfigurationLocation.cs
- RelationshipEndMember.cs
- DataObjectSettingDataEventArgs.cs
- AstTree.cs
- MetadataCache.cs
- Parsers.cs
- ManagedWndProcTracker.cs
- XmlSchemaCollection.cs
- RecommendedAsConfigurableAttribute.cs
- DataGridView.cs
- SqlDataSourceView.cs
- WebBrowserBase.cs
- OperationAbortedException.cs
- SqlInternalConnectionSmi.cs
- DateTimeParse.cs
- TileBrush.cs
- shaper.cs
- AlphabetConverter.cs
- CrossSiteScriptingValidation.cs
- PagedDataSource.cs
- List.cs
- FormViewInsertedEventArgs.cs
- ListSortDescription.cs
- SamlConstants.cs
- MsmqMessage.cs
- XmlMtomWriter.cs
- Condition.cs
- SelectionEditor.cs
- Solver.cs
- SemanticValue.cs
- TextServicesDisplayAttributePropertyRanges.cs
- VisualBrush.cs
- SimpleWebHandlerParser.cs
- AppDomainInfo.cs
- FormViewDeleteEventArgs.cs
- ClientFormsAuthenticationCredentials.cs
- MachinePropertyVariants.cs
- BindableTemplateBuilder.cs
- CorrelationKey.cs
- SchemaTypeEmitter.cs
- RoutingBehavior.cs
- BoolExpressionVisitors.cs
- MatrixCamera.cs
- FixedSOMTableRow.cs
- RoleManagerModule.cs
- FusionWrap.cs
- NavigatorOutput.cs
- ReadOnlyHierarchicalDataSource.cs
- QilCloneVisitor.cs
- Paragraph.cs
- EntityProxyTypeInfo.cs
- PreviewKeyDownEventArgs.cs
- DefaultProxySection.cs
- PathFigureCollectionConverter.cs
- _SpnDictionary.cs
- codemethodreferenceexpression.cs
- TextPatternIdentifiers.cs
- CompilerTypeWithParams.cs
- WmlSelectionListAdapter.cs
- EntityContainerAssociationSet.cs
- UndirectedGraph.cs
- XmlToDatasetMap.cs
- TableLayoutSettingsTypeConverter.cs
- FileDataSourceCache.cs
- EntityDataSourceEntityTypeFilterItem.cs
- VirtualPathProvider.cs
- ApplyImportsAction.cs
- ConfigurationFileMap.cs
- WebResponse.cs
- InternalDispatchObject.cs
- SmtpException.cs
- InputBinder.cs
- TextContainerHelper.cs
- XsdDateTime.cs
- HwndAppCommandInputProvider.cs
- WebPartEditorApplyVerb.cs
- DesignerExtenders.cs