1
我想使用Activator.CreateInstance設置字典的初始大小,請問該語法是什麼?如何爲Activator.CreateInstance設置字典大小?
var collection = Activator.CreateInstance(someDictionaryType) as IDictionary;
我想使用Activator.CreateInstance設置字典的初始大小,請問該語法是什麼?如何爲Activator.CreateInstance設置字典大小?
var collection = Activator.CreateInstance(someDictionaryType) as IDictionary;
如果你想叫一個Dictionary
constructor with an int parameter representing capacity,傳遞一個object
陣列的單個元素 - 大小:
var collection = Activator.CreateInstance(someDictionaryType, new object[] {123}) as IDictionary;