private System.Reflection.PropertyInfo PInfo = null;
private string GetValue(string Name)
{
try
{
PInfo = GetProperty(Name);
return PInfo.GetValue(wfkh, null).ToString();
}
catch
{
return string.Empty;
}
}
private void FillTextBoxValue()
{
foreach (Control ctr in this.tableLayoutPanel1.Controls)
{
if (ctr is TextBox)
{
TextBox txt = (TextBox)ctr;
string Name = txt.Name.Substring(3);
txt.Text = GetValue(Name);
}
}
}
private void SetTextBoxValue()
{
foreach (Control ctr in this.tableLayoutPanel1.Controls)
{
if (ctr is TextBox)
{
TextBox txt = (TextBox)ctr;
string Name = txt.Name.Substring(3);
PInfo = GetProperty(Name);
PInfo.SetValue(wfkh, txt.Text, null);
}
}
}
private System.Reflection.PropertyInfo GetProperty(string Name)
{
return wfkh.GetType().GetProperty(Name);
}