Figure 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 Figure 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| Figure() |
初始化类的新空实例 Figure 。 |
| Figure(Block) | |
| Figure(Block, TextPointer) |
初始化 Figure 类的新实例,将指定的 Block 对象作为新 Figure的初始内容,以及指定新 TextPointer 元素的插入位置的 Figure。 |
Figure()
Figure(Block)
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)
参数
示例
以下示例演示如何使用此构造函数。
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)
参数
- 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)