i write some utility class but how to get name ? Can that send parameter Name to Mehod not use object.Name?
class AutoConfig_Control {
public List<string> ls;
public AutoConfig_Control(List<string> lv)
{
ls = lv;
}
public void Add(object t)
{
//t.Name; << How to do this
//Howto Get t.Name in forms?
ls.Add(t.ToString());
}
}
class AutoConfig
{
List<string> ls = new List<string>();
public string FileConfig
{
set;
get;
}
public AutoConfig_Control Config
{
get {
AutoConfig_Control ac = new AutoConfig_Control(ls);
ls = ac.ls;
return ac;
}
//get;
}
public string SaveConfig(object t) {
return ls[0].ToString();
}
}
Example For use.
AutoConfig.AutoConfig ac = new AutoConfig.AutoConfig();
ac.Config.Add(checkBox1.Checked);
MessageBox.Show(ac.SaveConfig(checkBox1.Checked));