Run Konstruktory
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Inicializuje novou instanci Run třídy.
Přetížení
| Name | Description |
|---|---|
| Run() |
Inicializuje novou výchozí instanci Run třídy. |
| Run(String) |
Inicializuje novou instanci Run třídy a vezme zadaný řetězec jako počáteční obsah textu spuštění. |
| Run(String, TextPointer) |
Inicializuje novou instanci Run třídy, vezme zadaný řetězec jako počáteční obsah textu a TextPointer určí pozici vložení pro spuštění textu. |
Run()
Inicializuje novou výchozí instanci Run třídy.
public:
Run();
public Run();
Public Sub New ()
Platí pro
Run(String)
Inicializuje novou instanci Run třídy a vezme zadaný řetězec jako počáteční obsah textu spuštění.
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
Příklady
Následující příklad ukazuje použití tohoto konstruktoru.
Run textRun = new Run("The text contents of this text run.");
Dim textRun As New Run("The text contents of this text run.")
Platí pro
Run(String, TextPointer)
Inicializuje novou instanci Run třídy, vezme zadaný řetězec jako počáteční obsah textu a TextPointer určí pozici vložení pro spuštění textu.
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
- insertionPosition
- TextPointer
Určuje TextPointer pozici vložení, do které se má text vložit po vytvoření, nebo null pro automatické vložení.
Příklady
Následující příklad ukazuje použití tohoto konstruktoru.
// 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)