/// <summary> /// 初始化 /// </summary> /// <param name="searchpanel"></param> /// <param name="strServerUrl"></param> /// <param name="strSeedDbName"></param> public void Initial( SearchPanel searchpanel, string strServerUrl, string strSeedDbName) { this.SearchPanel = searchpanel; /* this.SearchPanel.InitialStopManager(this.button_stop, this.label_message); */ this.ServerUrl = strServerUrl; this.SeedDbName = strSeedDbName; }
/// <summary> /// 初始化 /// </summary> /// <param name="searchpanel"></param> /// <param name="strServerUrl"></param> /// <param name="strSeedDbName"></param> public void Initial( SearchPanel searchpanel, string strServerUrl, string strSeedDbName) { this.SearchPanel = searchpanel; /* * this.SearchPanel.InitialStopManager(this.button_stop, * this.label_message); */ this.ServerUrl = strServerUrl; this.SeedDbName = strSeedDbName; }
/// <summary> /// 初始化 /// </summary> /// <param name="searchpanel">检索面板</param> /// <param name="strServerUrl">主服务器URL</param> /// <param name="bAutoBeginSearch">当对话框打开后是否自动开始检索</param> public void Initial( SearchPanel searchpanel, string strServerUrl, bool bAutoBeginSearch) { this.SearchPanel = searchpanel; this.SearchPanel.InitialStopManager(this.button_stop, this.label_message); this.ServerUrl = strServerUrl; this.m_bAutoBeginSearch = bAutoBeginSearch; }
// 启动查重 // parameters: // strRecordPath 记录路径。如果==null,表示直接用textBox_recPath中当前的内容作为路径 public void SearchDup(string strRecordPath) { if (strRecordPath == null || strRecordPath == "") strRecordPath = textBox_recPath.Text; if (strRecordPath == "") { MessageBox.Show(this, "必须指定好路径后, 才能进行查重"); return; } ResPath respath = new ResPath(strRecordPath); string strError; string strXml = ""; bool bHasUploadedFile = false; int nRet = GetXmlRecord(out strXml, out bHasUploadedFile, out strError); if (nRet == -1) { MessageBox.Show(this, strError); return; } // 最好激活当前已经存在的查重mdi窗口 DupDlg dlg = new DupDlg(); dlg.Font = GuiUtil.GetDefaultFont(); // dlg.TopMost = true; dlg.OpenDetail -= new OpenDetailEventHandler(this.MainForm.OpenDetailCallBack); dlg.OpenDetail += new OpenDetailEventHandler(this.MainForm.OpenDetailCallBack); dlg.Closed -= new EventHandler(dupdlg_Closed); dlg.Closed += new EventHandler(dupdlg_Closed); SearchPanel searchpanel = new SearchPanel(); searchpanel.Initial(this.MainForm.Servers, this.MainForm.cfgCache); searchpanel.ap = this.MainForm.AppInfo; searchpanel.ApCfgTitle = "detailform_dupdlg"; string strDbFullName = respath.Url + "?" + ResPath.GetDbName(respath.Path); // 获得上次遗留的缺省查重方案名 string strDupProjectName = GetUsedDefaultDupProject(strDbFullName); dlg.Initial(searchpanel, respath.Url, true); dlg.ProjectName = strDupProjectName; dlg.RecordFullPath = strRecordPath; dlg.Record = strXml; dlg.MdiParent = this.MainForm; // MDI化 dlg.Show(); // this.MainForm.SetFirstMdiWindowState(); }
/// <summary> /// 初始化 /// </summary> /// <param name="searchpanel">检索面板</param> /// <param name="strServerUrl">服务器URL</param> /// <param name="strDbName">分类主题对照库名</param> public void Initial( SearchPanel searchpanel, /*ServerCollection servers, CfgCache cfgcache,*/ string strServerUrl, string strDbName) { /* this.Servers = servers; this.Channels.procAskAccountInfo = new Delegate_AskAccountInfo(this.Servers.AskAccountInfo); this.cfgCache = cfgcache; */ this.SearchPanel = searchpanel; this.SearchPanel.InitialStopManager(this.button_stop, this.label_message); this.ServerUrl = strServerUrl; if (strDbName != null) this.DbName = strDbName; FormEncoding = "utf-8"; }
/// <summary> /// 初始化 /// </summary> /// <param name="searchpanel">检索面板</param> /// <param name="strServerUrl">服务器URL</param> /// <param name="strGroupName">组名称</param> /// <param name="strClassNumber">分类号</param> /// <param name="bAutoBeginSearch">对话框打开后是否自动开始检索</param> public void Initial( SearchPanel searchpanel, /*ServerCollection servers, CfgCache cfgcache, */ string strServerUrl, string strGroupName, string strClassNumber, bool bAutoBeginSearch) { /* this.Servers = servers; this.Channels.procAskAccountInfo = new Delegate_AskAccountInfo(this.Servers.AskAccountInfo); this.cfgCache = cfgcache; */ this.SearchPanel = searchpanel; this.SearchPanel.InitialStopManager(this.button_stop, this.label_message); this.ServerUrl = strServerUrl; this.GroupName = strGroupName; this.ClassNumber = strClassNumber; this.m_bAutoBeginSearch = bAutoBeginSearch; }
// 分类主题对照 private void MenuItem_class2Subject_Click(object sender, EventArgs e) { Class2SubjectDlg dlg = new Class2SubjectDlg(); MainForm.SetControlFont(dlg, this.DefaultFont); // dlg.TopMost = true; dlg.CopySubject += new CopySubjectEventHandler(this.CopySubject); SearchPanel searchpanel = new SearchPanel(); searchpanel.Initial(this.Servers, this.cfgCache); searchpanel.ap = this.AppInfo; searchpanel.ApCfgTitle = "mainform_class2subjectdlg"; // 获得上次遗留的URL string strLastUrl = this.AppInfo.GetString( "class2subject", "url", "http://dp2003.com/dp2kernel"); dlg.Closed -= new EventHandler(class2subjectdlg_Closed); dlg.Closed += new EventHandler(class2subjectdlg_Closed); this.AppInfo.LinkFormState(dlg, "class2subjectdlg_state"); dlg.Initial(searchpanel, strLastUrl, // "http://dp2003.com/rmsws/rmsws.asmx", "分类主题对照"); dlg.CssUrl = Environment.CurrentDirectory + "\\class2subject.css"; dlg.Show(); dlg.MdiParent = this; }
// 管理种次号 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; }
// 询问无法匹配的源路径如何处理 // return: // -1 出错 // 0 cancel全部处理 // 1 已经选择处理办法 public static int AskNotMatchOriginBox( IWin32Window owner, ApplicationInfo ap, string strComment, SearchPanel searchpanel, string strOrigin, DbNameMap map) { DbNameMapItemDlg dlg = new DbNameMapItemDlg(); dlg.Font = GuiUtil.GetDefaultFont(); dlg.Comment = strComment; dlg.AskMode = AskMode.AskNotMatchOrigin; dlg.SearchPanel = searchpanel; dlg.Origin = strOrigin; dlg.Target = ""; dlg.WriteMode = "append"; dlg.Text = "请指定映射关系"; if (ap != null) ap.LinkFormState(dlg, "AskNotMatchOriginBox_state"); dlg.ShowDialog(owner); if (ap != null) ap.UnlinkFormState(dlg); if (dlg.DialogResult != DialogResult.OK) return 0; // cancel string strError = ""; if (map.NewItem(dlg.Origin, dlg.Target, dlg.WriteMode, 0, // 插入最前面 out strError) == null) { MessageBox.Show(owner, strError); return -1; } return 1; }