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;