public static void SettingsWidgetReload() { try { settingsWidget.Close(); settingsWidget = new SettingsWidget(settingsWidgetPreviousIPCMsg); settingsWidget.FormClosed += SettingsWidget_FormClosed; settingsWidget.Show(); } catch { //todo: logging. } }
/// <summary> /// std I/O redirect, used to communicate with lively. /// todo:- rewrite with named pipes. /// </summary> public async static void ListenToParent() { try { await Task.Run(async() => { while (true) // Loop runs only once per line received { string text = await Console.In.ReadLineAsync(); if (String.Equals(text, "Terminate", StringComparison.OrdinalIgnoreCase)) { break; } else if (String.Equals(text, "Reload", StringComparison.OrdinalIgnoreCase)) { chromeBrowser.Reload(true); } else if (Contains(text, "lively-customise", StringComparison.OrdinalIgnoreCase)) { try { if (settingsWidget == null) { mainForm.Invoke((MethodInvoker) delegate() { settingsWidgetPreviousIPCMsg = text; settingsWidget = new SettingsWidget(text); settingsWidget.FormClosed += SettingsWidget_FormClosed; settingsWidget.Show(); }); } else { settingsWidget.Activate(); } } catch { //todo: logging. } } } }); Application.Exit(); } catch { } }
private static void SettingsWidget_FormClosed(object sender, FormClosedEventArgs e) { settingsWidget = null; }