语言

Figure 构造函数

定义

初始化 Figure 类的新实例。

重载

名称 说明
Figure()

初始化类的新空实例 Figure 。

Figure(Block)

初始化 Figure 类的新实例,将指定的 Block 对象作为新 Figure的初始内容。

Figure(Block, TextPointer)

初始化 Figure 类的新实例,将指定的 Block 对象作为新 Figure的初始内容,以及指定新 TextPointer 元素的插入位置的 Figure。

Figure()

初始化类的新空实例 Figure 。

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

适用于

Figure(Block)

初始化 Figure 类的新实例,将指定的 Block 对象作为新 Figure的初始内容。

public:
 Figure(System::Windows::Documents::Block ^ childBlock);
public Figure(System.Windows.Documents.Block childBlock);
new System.Windows.Documents.Figure : System.Windows.Documents.Block -> System.Windows.Documents.Figure
Public Sub New (childBlock As Block)

参数

childBlock
Block

一个 Block 对象,指定新 Figure内容的初始内容。

示例

以下示例演示如何使用此构造函数。

Paragraph parx = new Paragraph(new Run("Figure content..."));
Figure figx = new Figure(parx);
Dim parx1 As New Paragraph(New Run("Figure content..."))
Dim figx1 As New Figure(parx1)

适用于

Figure(Block, TextPointer)

初始化 Figure 类的新实例,将指定的 Block 对象作为新 Figure的初始内容,以及指定新 TextPointer 元素的插入位置的 Figure。

public:
 Figure(System::Windows::Documents::Block ^ childBlock, System::Windows::Documents::TextPointer ^ insertionPosition);
public Figure(System.Windows.Documents.Block childBlock, System.Windows.Documents.TextPointer insertionPosition);
new System.Windows.Documents.Figure : System.Windows.Documents.Block * System.Windows.Documents.TextPointer -> System.Windows.Documents.Figure
Public Sub New (childBlock As Block, insertionPosition As TextPointer)

参数

childBlock
Block

一个 Block 对象,指定新 Figure内容的初始内容。 此参数可以是 null,在这种情况下,不会 Block 插入任何参数。

insertionPosition
TextPointer

一 TextPointer 个指定插入位置,在创建元素后插入 Figure 元素,或者 null 不进行自动插入。

示例

以下示例演示如何使用此构造函数。

Span spanx = new Span();
Paragraph parx = new Paragraph(new Run("Figure content..."));
// This will populate the Figure with the Paragraph parx, and insert
// the Figure at the beginning of the Span spanx.
Figure figx = new Figure(parx, spanx.ContentStart);
Dim spanx2 As New Span()
Dim parx2 As New Paragraph(New Run("Figure content..."))
    ' This will populate the Figure with the Paragraph parx, and insert
    ' the Figure at the beginning of the Span spanx.
Dim figx2 As New Figure(parx2, spanx2.ContentStart)

适用于