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)