How to transfer a parameter to a structure in a class?
In a class (MySubClass) I have defined a private structure (I don't want it
to be public) and a property {get; set} like this
private TestStruct
{
public int member_1;
public int member_2;
}
TestStruct TS = new TestStruct();
public TestStruct members
{
get
{
return TS;
}
set
{
TS = value;
}
}
In another class (MyParentClass) Doing this:
MySubClass tc = new MySubClass();
testVariable = tc.members.member_1;
works very well ! But doing this:
tc.members.member_1 = testVariable;
Doesn't work - the compiler raises an error saying:
"Cannot modify the return value of
'Application_for_tests.TestClass.variables' because it is not a variable"
So how is the correct way to do stuff like that?
Thanks
Ole