public void CrashAll() { foreach (KeyValuePair <string, string> pair in processes) { IGeneralControlServices node = Activator.GetObject(typeof(IGeneralControlServices), pair.Value) as IGeneralControlServices; logServer.LogAction("Crash " + pair.Key); node.Crash(); } processes.Clear(); parentForm.BeginInvoke(new Enable(parentForm.EnableConfigFiles), true); parentForm.BeginInvoke(new Enable(parentForm.EnableScriptFiles), false); }
public void Crash(string processName) { if (!processes.ContainsKey(processName)) { return; } IGeneralControlServices node = Activator.GetObject(typeof(IGeneralControlServices), processes[processName]) as IGeneralControlServices; logServer.LogAction("Crash " + processName); node.Crash(); processes.Remove(processName); if (processes.Count == 0) { parentForm.BeginInvoke(new Enable(parentForm.EnableConfigFiles), true); parentForm.BeginInvoke(new Enable(parentForm.EnableScriptFiles), false); } }