dockPanel1.LoadFromXml的参数问题
代码和例程差不多,可以读取和写入config文件了,
不过我不明白这个方法 m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
GetContentFromPersistString 这个方法的声明带一个字符参数啊,怎么可以像上面那样调用???
private bool m_bSaveLayout = true;
private DeserializeDockContent m_deserializeDockContent;
private MRP.UI.ToolWindow menuTool=new MRP.UI.ToolWindow();
private MRP.UI.SecurityTool stTool = new MRP.UI.SecurityTool();
public MainFM()
{
InitializeComponent();
m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
}
private IDockContent GetContentFromPersistString(string persistString)
{
if (persistString == typeof(MRP.UI.ToolWindow).ToString())
return menuTool;
else if (persistString == typeof(MRP.UI.SecurityTool).ToString())
return stTool;
else
{
return null;
}
}
private void MainFM_Load(object sender, EventArgs e)
{
string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config ");
if (File.Exists(configFile))
dockPanel1.LoadFromXml(configFile, m_deserializeDockContent);
menuTool.Show(this.dockPanel1);