List 构造函数

定义

初始化 List 类的新实例。

重载

List()

初始化 List 类的新的空实例。

List(ListItem)

初始化 List 类的一个新实例,将指定的 ListItem 对象作为新的 List 的初始内容。

List()

初始化 List 类的新的空实例。

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

适用于

List(ListItem)

初始化 List 类的一个新实例,将指定的 ListItem 对象作为新的 List 的初始内容。

public:
 List(System::Windows::Documents::ListItem ^ listItem);
public List (System.Windows.Documents.ListItem listItem);
new System.Windows.Documents.List : System.Windows.Documents.ListItem -> System.Windows.Documents.List
Public Sub New (listItem As ListItem)

参数

listItem
ListItem

一个 ListItem 对象,它指定新的 List 的初始内容。

示例

以下示例演示此构造函数的用法。

// This line uses the ListItem constructor to create a new ListItem
// and initialize it with the specified Paragraph.
ListItem lix = new ListItem(new Paragraph(new Run("ListItem text...")));
// This line uses the List constructor to create a new List and populate
// it with the previously created ListItem.
List listx = new List(lix);
' This line uses the ListItem constructor to create a new ListItem
' and initialize it with the specified Paragraph.
Dim lix As New ListItem(New Paragraph(New Run("ListItem text...")))
' This line uses the List constructor to create a new List and populate
' it with the previously created ListItem.
Dim listx As New List(lix)

适用于