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)