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
- SaveFileDialog.cs
- CrossContextChannel.cs
- ResizeBehavior.cs
- SQLInt32Storage.cs
- OleDbEnumerator.cs
- OleDbTransaction.cs
- Int64KeyFrameCollection.cs
- CodeAttributeArgument.cs
- HtmlTable.cs
- Vector3dCollection.cs
- EditorBrowsableAttribute.cs
- DebuggerAttributes.cs
- InternalMappingException.cs
- RtfToXamlReader.cs
- WindowsButton.cs
- HtmlTableCell.cs
- TimeStampChecker.cs
- SmtpDigestAuthenticationModule.cs
- SocketElement.cs
- SafeViewOfFileHandle.cs
- AlternationConverter.cs
- MetadataArtifactLoaderComposite.cs
- WindowsRegion.cs
- OdbcConnectionHandle.cs
- SynchronizingStream.cs
- ResourceAssociationType.cs
- CallContext.cs
- FontWeights.cs
- MouseDevice.cs
- CodeMethodMap.cs
- PaperSource.cs
- SqlDataSourceRefreshSchemaForm.cs
- HttpAsyncResult.cs
- AttachInfo.cs
- ParseChildrenAsPropertiesAttribute.cs
- IsolatedStoragePermission.cs
- TextEffect.cs
- SoapEnumAttribute.cs
- HandledMouseEvent.cs
- WebServiceAttribute.cs
- RectAnimationBase.cs
- PointF.cs
- UniqueSet.cs
- CollectionExtensions.cs
- EdgeProfileValidation.cs
- Error.cs
- ReceiveContextCollection.cs
- QueueException.cs
- LinqDataSourceUpdateEventArgs.cs
- ReflectTypeDescriptionProvider.cs
- wmiprovider.cs
- HasCopySemanticsAttribute.cs
- WebPartsSection.cs
- WizardStepBase.cs
- IsolatedStorageFileStream.cs
- LogicalTreeHelper.cs
- Metadata.cs
- PropertyKey.cs
- SwitchElementsCollection.cs
- ScrollItemProviderWrapper.cs
- NegotiateStream.cs
- SqlDataSource.cs
- WorkflowValidationFailedException.cs
- WorkflowHostingEndpoint.cs
- TemplateEditingFrame.cs
- BitmapEffectDrawing.cs
- SizeConverter.cs
- KeyConverter.cs
- DefaultExpressionVisitor.cs
- DbBuffer.cs
- ExecutionEngineException.cs
- StaticFileHandler.cs
- DispatcherProcessingDisabled.cs
- HtmlInputFile.cs
- Pts.cs
- SelectionRange.cs
- SafeRightsManagementHandle.cs
- ActivityInstanceReference.cs
- CodeBinaryOperatorExpression.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- EllipticalNodeOperations.cs
- TokenFactoryBase.cs
- WebSysDefaultValueAttribute.cs
- ISFTagAndGuidCache.cs
- HtmlControlPersistable.cs
- ArraySortHelper.cs
- StringSorter.cs
- CompositionAdorner.cs
- XmlException.cs
- EmptyCollection.cs
- RegexCharClass.cs
- Range.cs
- EntityViewGenerationAttribute.cs
- OracleDateTime.cs
- OleDbFactory.cs
- StateManagedCollection.cs
- VirtualPath.cs
- ReadOnlyCollectionBuilder.cs
- QuaternionConverter.cs
- X509Certificate2.cs