Run Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy Run.

Przeciążenia

Run()

Inicjuje nowe, domyślne wystąpienie Run klasy.

Run(String)

Inicjuje Run nowe wystąpienie klasy, biorąc określony ciąg jako początkową zawartość przebiegu tekstu.

Run(String, TextPointer)

Inicjuje nowe wystąpienie Run klasy, biorąc określony ciąg jako początkową zawartość przebiegu tekstu i TextPointer określając pozycję wstawiania dla przebiegu tekstu.

Run()

Inicjuje nowe, domyślne wystąpienie Run klasy.

public:
 Run();
public Run ();
Public Sub New ()

Dotyczy

Run(String)

Inicjuje Run nowe wystąpienie klasy, biorąc określony ciąg jako początkową zawartość przebiegu tekstu.

public:
 Run(System::String ^ text);
public Run (string text);
new System.Windows.Documents.Run : string -> System.Windows.Documents.Run
Public Sub New (text As String)

Parametry

text
String

Ciąg określający początkową zawartość Run obiektu.

Przykłady

W poniższym przykładzie pokazano użycie tego konstruktora.

Run textRun = new Run("The text contents of this text run.");
Dim textRun As New Run("The text contents of this text run.")

Dotyczy

Run(String, TextPointer)

Inicjuje nowe wystąpienie Run klasy, biorąc określony ciąg jako początkową zawartość przebiegu tekstu i TextPointer określając pozycję wstawiania dla przebiegu tekstu.

public:
 Run(System::String ^ text, System::Windows::Documents::TextPointer ^ insertionPosition);
public Run (string text, System.Windows.Documents.TextPointer insertionPosition);
new System.Windows.Documents.Run : string * System.Windows.Documents.TextPointer -> System.Windows.Documents.Run
Public Sub New (text As String, insertionPosition As TextPointer)

Parametry

text
String

Ciąg określający początkową zawartość Run obiektu.

insertionPosition
TextPointer

Określenie TextPointer położenia wstawiania, w którym ma zostać wstawiony tekst uruchamiany po jego utworzeniu lub null bez automatycznego wstawiania.

Przykłady

W poniższym przykładzie pokazano użycie tego konstruktora.

// Create a new, empty paragraph to host the text run.
Paragraph par = new Paragraph();

// Get a TextPointer for the end of content in the paragraph.
TextPointer insertionPoint = par.ContentEnd;

// This line will create a new text run, initialize it with the supplied string,
// and insert it at the specified insertion point (which happens to be the end of
// content for the host paragraph).
Run textRun = new Run("The text contents of this text run.", insertionPoint);
    ' Create a new, empty paragraph to host the text run.
    Dim par As New Paragraph()

    ' Get a TextPointer for the end of content in the paragraph.
    Dim insertionPoint As TextPointer = par.ContentEnd

    ' This line will create a new text run, initialize it with the supplied string,
    ' and insert it at the specified insertion point (which happens to be the end of
    ' content for the host paragraph).
Dim textRun2 As New Run("The text contents of this text run.", insertionPoint)

Dotyczy