CollectionsMarshal.SetCount<T>(List<T>, Int32) メソッド

定義

List<T>の数を指定した値に設定します。

public:
generic <typename T>
 static void SetCount(System::Collections::Generic::List<T> ^ list, int count);
public static void SetCount<T>(System.Collections.Generic.List<T> list, int count);
static member SetCount : System.Collections.Generic.List<'T> * int -> unit
Public Shared Sub SetCount(Of T) (list As List(Of T), count As Integer)

型パラメーター

T

リスト内の要素の型。

パラメーター

list
List<T>

カウントを設定するリスト。

count
Int32

リストのカウントを設定する値。

例外

listnullです。

count が負の値です。

注釈

カウントを増やすと、初期化されていないデータが公開されます。

適用対象