private void mnuRecognizeG2Folder_Click(object sender, EventArgs e) { if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { FInterpretG2 formInterpret = new FInterpretG2(); formInterpret.MdiParent = this; Hashtable tag = (Hashtable)formInterpret.Tag; tag.Add(TagKeys.AutomateSource, Core.Automate.Source.Folder); tag.Add(TagKeys.Caption, "Chấm điểm thư mục " + folderBrowserDialog.SelectedPath); tag.Add(TagKeys.Path, folderBrowserDialog.SelectedPath); AddWindowMenuItem(formInterpret, (string)tag[TagKeys.Caption]); formInterpret.Show(); } }
private void mnuG2File_Click(object sender, EventArgs e) { PrepareFileDlg2Interpret(); if (openFileDialog.ShowDialog() == DialogResult.OK && openFileDialog.FileNames.Length >= 1) { FInterpretG2 fig2 = new FInterpretG2(); fig2.MdiParent = this; Hashtable tag = (Hashtable)fig2.Tag; tag.Add(TagKeys.AutomateSource, Core.Automate.Source.Files); string[] fileNames = openFileDialog.FileNames; string[] safeFileName = new string[fileNames.Length]; for (int i = 0; i < fileNames.Length; i++) { safeFileName[i] = Core.Utility.GetSafeFileName(fileNames[i]); } fig2.txtLog.AppendText(string.Join(Environment.NewLine, safeFileName)); tag.Add(TagKeys.Caption, "Cham diem: " + string.Join(",", safeFileName)); tag.Add(TagKeys.Files, fileNames); AddWindowMenuItem(fig2, (string)tag[TagKeys.Caption]); fig2.Show(); } }