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 が負の値です。

注釈

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

適用対象