private void Run() { string processName = ""; bool end = false; toolStripButton1.Enabled = false; ErrorBase.ClearErrors(); SetDataDirOptions(); do { GetProcessName gName = new GetProcessName(opt.clusterAlgorithm.ToString()); gName.ShowDialog(); if (gName.DialogResult == DialogResult.OK) { List<string> keys = new List<string>(manager.clOutput.Keys); Dictionary<string, int> dic = new Dictionary<string, int>(); foreach (var item in keys) { string []aux = item.Split('_'); string l=""; for (int i = 0; i < aux.Length - 1; i++) l += aux[i]; if(!dic.ContainsKey(l)) dic.Add(l,1); } if (dic.ContainsKey(gName.name)) MessageBox.Show("Process name: " + gName.name + " already exists"); else { processName = gName.name; end = true; } } else return; } while (!end); manager.mUpdate = upMessage; try { TimeInterval.Start(); manager.RunJob(processName); } catch (Exception ex) { TimeInterval.Stop(); MessageBox.Show("Exception: " + ex.Message); } }
private void Run() { string processName = ""; bool end = false; toolStripButton1.Enabled = false; ErrorBase.ClearErrors(); SetDataDirOptions(); do { GetProcessName gName = new GetProcessName(opt.clusterAlgorithm.ToString()); gName.ShowDialog(); if (gName.DialogResult == DialogResult.OK) { List <string> keys = new List <string>(manager.clOutput.Keys); Dictionary <string, int> dic = new Dictionary <string, int>(); foreach (var item in keys) { string [] aux = item.Split('_'); string l = ""; for (int i = 0; i < aux.Length - 1; i++) { l += aux[i]; } if (!dic.ContainsKey(l)) { dic.Add(l, 1); } } if (dic.ContainsKey(gName.name)) { MessageBox.Show("Process name: " + gName.name + " already exists"); } else { processName = gName.name; end = true; } } else { return; } }while (!end); manager.mUpdate = upMessage; try { TimeInterval.Start(); manager.RunJob(processName); } catch (Exception ex) { TimeInterval.Stop(); MessageBox.Show("Exception: " + ex.Message); } }