S
Shmuel
Hi,
I need to get public fields that are set as follows:
private string _name;
public string name
{
set { _name = value; }
get { return _name; }
}
I've tried something like this:
Language l = Language.createEmptyInstance();
l.name = "ADSFAFDADSF";
FieldInfo field = l.GetType().GetField("_name", BindingFlags.GetField |
BindingFlags.NonPublic | BindingFlags.Instance |
BindingFlags.Public);
Object val = field.GetValue(l);
MessageBox.Show(l.ToString() + "\n\n" + val.ToString());
It works for normal variables, but not those that are set by setters and
getters.
Any idea how to get those ones too?
Thanks,
Shmuel
I need to get public fields that are set as follows:
private string _name;
public string name
{
set { _name = value; }
get { return _name; }
}
I've tried something like this:
Language l = Language.createEmptyInstance();
l.name = "ADSFAFDADSF";
FieldInfo field = l.GetType().GetField("_name", BindingFlags.GetField |
BindingFlags.NonPublic | BindingFlags.Instance |
BindingFlags.Public);
Object val = field.GetValue(l);
MessageBox.Show(l.ToString() + "\n\n" + val.ToString());
It works for normal variables, but not those that are set by setters and
getters.
Any idea how to get those ones too?
Thanks,
Shmuel