MinMaxParagraphWidth Yapı

Tanım

Belirtilen metin içeriğini tam olarak içerebilen mümkün olan en küçük ve en büyük paragraf genişliğini temsil eder.

public value class MinMaxParagraphWidth : IEquatable<System::Windows::Media::TextFormatting::MinMaxParagraphWidth>
public struct MinMaxParagraphWidth : IEquatable<System.Windows.Media.TextFormatting.MinMaxParagraphWidth>
type MinMaxParagraphWidth = struct
Public Structure MinMaxParagraphWidth
Implements IEquatable(Of MinMaxParagraphWidth)
Devralma
MinMaxParagraphWidth
Uygulamalar

Örnekler

Aşağıdaki örnekte, biçimlendirilmiş metin satırları için en düşük paragraf genişliğini oluşturmak üzere özelliğinin nasıl kullanılacağı MinWidth gösterilmektedir.

MinMaxParagraphWidth minMaxParaWidth =
    formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties);

// Format each line of text from the text store and draw it.
while (textStorePosition < customTextSource.Text.Length)
{
    // Create a textline from the text store using the TextFormatter object.
    using (TextLine myTextLine = formatter.FormatLine(
        customTextSource,
        textStorePosition,
        minMaxParaWidth.MinWidth,
        customTextParagraphProperties,
        null))
    {
        // Draw the formatted text into the drawing context.
        myTextLine.Draw(drawingContext, linePosition, InvertAxes.None);

        // Update the index position in the text store.
        textStorePosition += myTextLine.Length;

        // Update the line position coordinate for the displayed line.
        linePosition.Y += myTextLine.Height;
    }
}
Dim minMaxParaWidth As MinMaxParagraphWidth = formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties)

' Format each line of text from the text store and draw it.
Do While textStorePosition < customTextSource.Text.Length
    ' Create a textline from the text store using the TextFormatter object.
    Using myTextLine As TextLine = formatter.FormatLine(customTextSource, textStorePosition, minMaxParaWidth.MinWidth, customTextParagraphProperties, Nothing)
        ' Draw the formatted text into the drawing context.
        myTextLine.Draw(drawingContext, linePosition, InvertAxes.None)

        ' Update the index position in the text store.
        textStorePosition += myTextLine.Length

        ' Update the line position coordinate for the displayed line.
        linePosition.Y += myTextLine.Height
    End Using
Loop

Özellikler

MaxWidth

Belirtilen metin içeriğini tam olarak içerebilen mümkün olan en büyük paragraf genişliğini alır.

MinWidth

Belirtilen metin içeriğini tam olarak içerebilecek en küçük paragraf genişliğini alır.

Yöntemler

Equals(MinMaxParagraphWidth)

öğesinin CharacterBufferReference geçerli CharacterBufferReference nesneye eşit olup olmadığını belirler.

Equals(Object)

Belirtilen nesnenin geçerli CharacterBufferReference nesneye eşit olup olmadığını belirler.

GetHashCode()

için CharacterBufferReferencekarma işlevi işlevi görür. Karma algoritmalarında ve karma tablo gibi veri yapılarında kullanıma uygundur.

İşleçler

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Eşitlik için iki CharacterBufferReference dizeyi karşılaştırın.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Eşitsizlik için iki CharacterBufferReference nesneyi karşılaştırın.

Şunlara uygulanır

Ayrıca bkz.