日期:2014-05-17 浏览次数:20893 次
private void treeview_NodeSelected(object sender, EventArgs e)
{
var typeName = 查询节点对应的UI类型信息(treeview1.SelectedValue);
var ts = typeName = typeName.Split(',');
var asm = Assembly.LoadFrom(ts[1]);
var ctrl = (UserControl)Activator.CreateInstance(asm.GetType(ts[0]));
Panel1.Controls.Clear();
Panel1.Controls.Add(ctrl);
}
void treeview_NodeSelected(object sender, EventArgs e)
{
var typeName = 查询节点对应的UI类型信息(treeview1.SelectedValue);
var ts = typeName = typeName.Split(',');
var asm = Assembly.LoadFrom(ts[1]);
var ctrl = (UserControl)Activator.CreateInstance(asm.GetType(ts[0]));
Panel1.Controls.Clear();
Panel1.Controls.Add(ctrl);
var ca = ctrl as IRequireDatasA;
if(ca !=null)
ca.SetDatas(this.DataA);
var cb = ctrl as IRequireDatasB;
if(cb !=null)
cb.SetDatas(this.DataB);
var cc = ctrl as IRequireDatasC;
if(cc !=null)
vc.SetDatas(this.DataC);
}