|
|
От: | nerozero | |
| Дата: | 07.09.08 05:51 | ||
| Оценка: | |||
Type[] types;
...
public object CreateInstance(int id)
{
return CreateInstance(types[id]);
}
public object CreateInstance(Type t)
{
ConstructorInfo ci = t.GetConstructor(Type.EmptyTypes);
return ci.Invoke(null);
}