Passing SystemType as a param
От: Аноним  
Дата: 02.12.03 12:29
Оценка:
How do I pass field of type System.Type... Can't type

private t as New Type , thus state is always lost — any ideas ? I need to pass Type to re-construct instance from it.
Spasibo.
Re: Passing SystemType as a param
От: Banch  
Дата: 02.12.03 15:47
Оценка:
не очень понятно о чем ты, но может так:

C#
private System.Type t;
private object o;
Re[2]: Passing SystemType as a param
От: Аноним  
Дата: 02.12.03 17:17
Оценка:
This way I gonna loose it — cos I have not storage for it....

M'kay — can you provide me with a small exmaple of how do I pass System.Type ?

Something like:
Dim o as MyClass
o.Type = GetType(...)

and after

Dim t as Type = o.Type — that won't work
Re[3]: Passing SystemType as a param
От: Banch  
Дата: 02.12.03 17:27
Оценка:
ты хочешь динамически создавать объекты из неизвестного заранее типа?
тогда так:
Type t = GetType(...)
object oNew = Activator.CreateInstance( t );


System.Type — это нормальный клаcc
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.