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
- CapabilitiesPattern.cs
- dataobject.cs
- SourceChangedEventArgs.cs
- NumericUpDown.cs
- ToolStripSplitStackLayout.cs
- EventLogPermissionEntry.cs
- CatalogPart.cs
- Listbox.cs
- NativeMethods.cs
- Models.cs
- NavigationWindow.cs
- LineBreak.cs
- ParameterCollection.cs
- WindowsRichEditRange.cs
- RawStylusInputReport.cs
- XPathNodeIterator.cs
- HttpEncoder.cs
- TimeIntervalCollection.cs
- CryptoConfig.cs
- XPathNodePointer.cs
- DetailsViewDesigner.cs
- XmlSchemaSequence.cs
- CodeTryCatchFinallyStatement.cs
- TextDecorationCollection.cs
- User.cs
- Message.cs
- HttpPostedFileWrapper.cs
- safemediahandle.cs
- DtdParser.cs
- RowType.cs
- GridEntryCollection.cs
- ScriptControlManager.cs
- AutomationIdentifierGuids.cs
- SafeProcessHandle.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ArrayItemReference.cs
- HierarchicalDataBoundControl.cs
- SchemaElementDecl.cs
- WebControl.cs
- CroppedBitmap.cs
- TextControlDesigner.cs
- SocketInformation.cs
- DataServiceExpressionVisitor.cs
- DesignerValidationSummaryAdapter.cs
- TogglePattern.cs
- GeometryModel3D.cs
- SiteMapPath.cs
- TreeNodeSelectionProcessor.cs
- x509store.cs
- ZipIOBlockManager.cs
- BoundingRectTracker.cs
- SyntaxCheck.cs
- ReadOnlyDataSourceView.cs
- HopperCache.cs
- unsafeIndexingFilterStream.cs
- SkinIDTypeConverter.cs
- Margins.cs
- FileDialogCustomPlaces.cs
- TableAdapterManagerHelper.cs
- MonthChangedEventArgs.cs
- SqlBooleanizer.cs
- WindowsSolidBrush.cs
- PrimitiveSchema.cs
- indexingfiltermarshaler.cs
- NativeMethodsOther.cs
- AuthorizationRuleCollection.cs
- BrowserDefinition.cs
- MemberInfoSerializationHolder.cs
- GlobalProxySelection.cs
- CngAlgorithmGroup.cs
- HostProtectionException.cs
- SecurityProtocol.cs
- FolderBrowserDialog.cs
- FixedPageAutomationPeer.cs
- SrgsRuleRef.cs
- DetailsViewCommandEventArgs.cs
- RelationshipConstraintValidator.cs
- DesignerHost.cs
- DataGridViewCellValidatingEventArgs.cs
- DrawingGroup.cs
- StreamInfo.cs
- HttpApplicationStateWrapper.cs
- IteratorDescriptor.cs
- PermissionToken.cs
- Size.cs
- InkPresenter.cs
- ChangeTracker.cs
- VersionedStreamOwner.cs
- PackUriHelper.cs
- PenLineJoinValidation.cs
- XmlSchemaExternal.cs
- FileSystemInfo.cs
- EventLogTraceListener.cs
- CodeDomLocalizationProvider.cs
- ChangePassword.cs
- PointConverter.cs
- PersonalizationProviderHelper.cs
- contentDescriptor.cs
- TextBreakpoint.cs
- ReadOnlyDictionary.cs