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
- DataSource.cs
- DesignerCategoryAttribute.cs
- ReflectionUtil.cs
- DataServices.cs
- RsaKeyIdentifierClause.cs
- HtmlInputControl.cs
- CompatibleComparer.cs
- SharedDp.cs
- SerializationSectionGroup.cs
- WebPartConnectionsConnectVerb.cs
- WindowsTitleBar.cs
- httpapplicationstate.cs
- ECDiffieHellmanCng.cs
- URLString.cs
- DataSourceView.cs
- SpecularMaterial.cs
- CultureInfoConverter.cs
- SessionStateModule.cs
- DefaultTraceListener.cs
- ConnectionManagementElement.cs
- ViewManager.cs
- RectKeyFrameCollection.cs
- GradientStopCollection.cs
- FormViewUpdatedEventArgs.cs
- ImageIndexConverter.cs
- ArglessEventHandlerProxy.cs
- DrawingContextWalker.cs
- XmlTextReaderImpl.cs
- WpfXamlMember.cs
- Stack.cs
- PrimarySelectionGlyph.cs
- StoreContentChangedEventArgs.cs
- XPathParser.cs
- BigInt.cs
- Timeline.cs
- KeyFrames.cs
- UpdatePanelTrigger.cs
- SQLBytes.cs
- Propagator.JoinPropagator.cs
- WebPartConnectionsConnectVerb.cs
- ColorConvertedBitmap.cs
- DesigntimeLicenseContextSerializer.cs
- ProfileGroupSettings.cs
- XpsFont.cs
- CompilerLocalReference.cs
- RefExpr.cs
- ValidationVisibilityAttribute.cs
- TraceListeners.cs
- SafeMarshalContext.cs
- OdbcParameter.cs
- XmlLoader.cs
- OdbcCommand.cs
- MissingManifestResourceException.cs
- MonthChangedEventArgs.cs
- DataGridViewSelectedColumnCollection.cs
- PropertyGeneratedEventArgs.cs
- ConfigurationException.cs
- TextParagraph.cs
- XamlFilter.cs
- CryptoHandle.cs
- SQlBooleanStorage.cs
- ITextView.cs
- SpellerStatusTable.cs
- Debug.cs
- AsyncOperationManager.cs
- Resources.Designer.cs
- ServiceInstanceProvider.cs
- RoutedCommand.cs
- PageRequestManager.cs
- HitTestWithPointDrawingContextWalker.cs
- OdbcEnvironmentHandle.cs
- Pair.cs
- XmlSignatureManifest.cs
- DataGridComponentEditor.cs
- ListItemsCollectionEditor.cs
- EndpointIdentityConverter.cs
- CollectionChangeEventArgs.cs
- SQLGuid.cs
- XhtmlBasicPageAdapter.cs
- CodeSnippetStatement.cs
- ExtendedPropertyDescriptor.cs
- System.Data_BID.cs
- COM2PropertyDescriptor.cs
- DataGridAddNewRow.cs
- ExpressionLexer.cs
- _NativeSSPI.cs
- figurelengthconverter.cs
- XmlSchemas.cs
- Stack.cs
- OrderedDictionary.cs
- HealthMonitoringSection.cs
- WindowClosedEventArgs.cs
- SizeKeyFrameCollection.cs
- WorkflowMarkupSerializationManager.cs
- CmsInterop.cs
- CheckoutException.cs
- HtmlGenericControl.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ToolBar.cs
- Privilege.cs