string strDllName = item.Tag.ToString().Trim().Substring(0, item.Tag.ToString().Trim().IndexOf("*"));
string strFrmName =item.Tag.ToString().Trim().Substring(item.Tag.ToString().Trim().IndexOf("*") +1,item.Tag.ToString().Trim().Length- item.Tag.ToString().Trim().IndexOf("*")-1) ;
try
{
object obj = Assembly.LoadFrom(strDllName + ".DLL").CreateInstance(strDllName.Substring(0, strDllName.Length - 3) + "." + strFrmName);
if (obj != null)
{
if (((frmMain)GetTopParent(this)).DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
{
((DockContent)obj).MdiParent = (frmMain)GetTopParent(this);
((DockContent)obj).Show();
}
else
{
for (int i = 0; i < this.DockPanel.Contents.Count; i++)
{
if (this.DockPanel.Contents[i].GetType().ToString() == obj.GetType().ToString() )
{
this.DockPanel.ActiveDocumentPane.ActiveContent = (DockContent)this.DockPanel.Contents[i]; //已经打开则击活
return;
}
}
((DockContent)obj).Show(((frmMain)GetTopParent(this)).DockPanel);
}
}