Run Constructeurs

Définition

Initialise une nouvelle instance de la classe Run.

Surcharges

Run()

Initialise une nouvelle instance par défaut de la classe Run.

Run(String)

Initialise une nouvelle instance de la classe Run, prenant une chaîne spécifiée comme contenu initial de l'exécution de texte.

Run(String, TextPointer)

Initialise une nouvelle instance de la classe Run, prenant une chaîne spécifiée comme contenu initial de la séquence de texte, ainsi qu'un TextPointer spécifiant une position d'insertion pour la séquence de texte.

Run()

Initialise une nouvelle instance par défaut de la classe Run.

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

S’applique à

Run(String)

Initialise une nouvelle instance de la classe Run, prenant une chaîne spécifiée comme contenu initial de l'exécution de texte.

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)

Paramètres

text
String

Chaîne spécifiant le contenu initial de l'objet Run.

Exemples

L’exemple suivant illustre l’utilisation de ce constructeur.

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

S’applique à

Run(String, TextPointer)

Initialise une nouvelle instance de la classe Run, prenant une chaîne spécifiée comme contenu initial de la séquence de texte, ainsi qu'un TextPointer spécifiant une position d'insertion pour la séquence de texte.

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)

Paramètres

text
String

Chaîne spécifiant le contenu initial de l'objet Run.

insertionPosition
TextPointer

TextPointer spécifiant une position d'insertion pour la séquence de texte après sa création, ou valeur null pour ne pas activer d'insertion automatique.

Exemples

L’exemple suivant illustre l’utilisation de ce constructeur.

// 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)

S’applique à