// 回调函数,保存使用过的Url private void zhongcihaodlg_Closed(object sender, EventArgs e) { ZhongcihaoDlg dlg = (ZhongcihaoDlg)sender; try { this.AppInfo.SetString( "zhongcihao", "url", dlg.ServerUrl); // this.applicationInfo.UnlinkFormState(dlg); } catch { } }
// 管理种次号 private void MenuItem_manageZhongcihao_Click(object sender, EventArgs e) { ZhongcihaoDlg dlg = new ZhongcihaoDlg(); MainForm.SetControlFont(dlg, this.DefaultFont); SearchPanel searchpanel = new SearchPanel(); searchpanel.Initial(this.Servers, this.cfgCache); searchpanel.ap = this.AppInfo; searchpanel.ApCfgTitle = "mainform_zhongcihaodlg"; // dlg.TopMost = true; dlg.OpenDetail -= new OpenDetailEventHandler(this.OpenDetailCallBack); dlg.OpenDetail += new OpenDetailEventHandler(this.OpenDetailCallBack); // 获得上次遗留的URL string strLastUrl = this.AppInfo.GetString( "zhongcihao", "url", "http://dp2003.com/dp2kernel"); dlg.Closed -= new EventHandler(zhongcihaodlg_Closed); dlg.Closed += new EventHandler(zhongcihaodlg_Closed); this.AppInfo.LinkFormState(dlg, "zhongcihaodlg_state"); dlg.Initial(searchpanel, strLastUrl, "中文书目", "", false); dlg.Show(); dlg.MdiParent = this; }