ITextParagraphPropertiesFactoryService.Create Method

Definition

Creates a TextParagraphProperties for the provided configuration.

public:
 System::Windows::Media::TextFormatting::TextParagraphProperties ^ Create(Microsoft::VisualStudio::Text::Formatting::IFormattedLineSource ^ formattedLineSource, Microsoft::VisualStudio::Text::Formatting::TextFormattingRunProperties ^ textProperties, Microsoft::VisualStudio::Text::IMappingSpan ^ line, Microsoft::VisualStudio::Text::IMappingPoint ^ lineStart, int lineSegment);
public System.Windows.Media.TextFormatting.TextParagraphProperties Create (Microsoft.VisualStudio.Text.Formatting.IFormattedLineSource formattedLineSource, Microsoft.VisualStudio.Text.Formatting.TextFormattingRunProperties textProperties, Microsoft.VisualStudio.Text.IMappingSpan line, Microsoft.VisualStudio.Text.IMappingPoint lineStart, int lineSegment);
abstract member Create : Microsoft.VisualStudio.Text.Formatting.IFormattedLineSource * Microsoft.VisualStudio.Text.Formatting.TextFormattingRunProperties * Microsoft.VisualStudio.Text.IMappingSpan * Microsoft.VisualStudio.Text.IMappingPoint * int -> System.Windows.Media.TextFormatting.TextParagraphProperties
Public Function Create (formattedLineSource As IFormattedLineSource, textProperties As TextFormattingRunProperties, line As IMappingSpan, lineStart As IMappingPoint, lineSegment As Integer) As TextParagraphProperties

Parameters

formattedLineSource
IFormattedLineSource

The IFormattedLineSource that's performing the formatting of the line. You can access useful properties about the ongoing formatting operation from this object.

textProperties
TextFormattingRunProperties

The TextFormattingRunProperties of the line for which TextParagraphProperties are to be provided. This paramter can be used to obtain formatting information about the textual contents of the line.

line
IMappingSpan

The IMappingSpan corresponding to the line that's being formatted/rendered.

lineStart
IMappingPoint

The IMappingPoint corresponding to the beginning of the line segment that's being formatted. This paramter is relevant for word-wrap scenarios where a single ITextSnapshotLine results in multiple formatted/rendered lines on the view.

lineSegment
Int32

The segment number of the line segment that's been currently formatted. This is a zero-based index and is applicable to word-wrapped lines. If a line is word-wrapped into 4 segments, you will receive 4 calls for the line with lineSegments of 0, 1, 2, and 3.

Returns

A TextParagraphProperties to be used when the line is being formatted.

Remarks

Please note that you can return a TextFormattingParagraphProperties which has a convenient set of basic properties defined.

Applies to