A I'm new to c# and I came from c++ also.
I want to create dynamicaly winform to get some data. I create a array
of object as a description of variable which I want to get. I pass this
array to a function which build a form, show the edit fields and return
changed values. Changed values are stored in my array of objects but
these original values are not changed.
Short code snipet ( this is working)
// ---- c# ----
struct desc {
object o;
enum otype t;
}
int i;
string s;
// I want to get new values for i and s;
desc o1 = new desc( i, t_int );
desc o2 = new desc(s, t_str );
desc [] d = new desc[] { o1, o2 };
get_value( d ); // this methode create winform, with dynamic contents,
get the data, and return a values.
// and now I need to:
i = (int)o1.o; // I want to skip these two lines
s=(string)o2.o;
//--------------------------------------------
In c++ I can do this like:
struct desc {
object o;
enum otype t;
}
int i;
string s;
desc d[] = { {&i, t_int}, {&s, t_str}};
get_value( d ); // this methode create winform, with dynamic contents,
get the data, and return a values.
// and at the end the original values are changed
//-------------------------------------------------
Is this possible to simplify c# solution? I want to ommit last two
asignments.
MiSo