/// <summary> /// Register to all built-in alerts. /// </summary> /// <param name="callback">Callback to register.</param> public static void RegisterToBuiltIns(AlertCallback callback) { foreach (var val in Enum.GetValues(typeof(PredefAlertTypes))) { var alert = _alerts[val]; alert.FrameAlertHandler += callback; alert.SecondAlertHandler += callback; alert.TimePeriodAlertHandler += callback; } }
public MainForm() { MainForm.alertCallback = this.attention; InitializeComponent(); this.Icon = Resources.evealert; string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/eve-alert/"; #if DEBUG configdir = appdata + "config_testing.xml"; #else configdir = appdata + "config.xml"; #endif if (Directory.Exists(appdata) == false) { Directory.CreateDirectory(appdata); } if (File.Exists(configdir) == false) { settings = new Settings(); new SettingsForm(settings).ShowDialog(); Settings.toXML(settings, configdir); } else { settings = Settings.fromXML(configdir); } if (settings.StartStarted) { this.toggleState(); } notificationForm = new NotificationForm(settings); /*Account acc = new Account(); acc.Charname = "TestAccount"; acc.alertModules.Add(new ChatLogAlert(new List<string> {"Test1", "Test2" }, "Testchannel")); settings.Accounts.Add(acc); saveSettings();*/ refreshAccounts(); refreshContextMenu(); refreshGui(); }
public void RegisterAlertCallback(AlertCallback func) { alertCallback += func; }
void AlertWindowFunc(int windowId) { GUI.enabled = true; GUILayout.BeginVertical(); GUILayout.Label(alertText, smallLabelStyle); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Cancel", GUILayout.Width(100), GUILayout.Height(70))) { if (alertCancelCallback != null) alertCancelCallback(); else GuiState = LastGuiState; alertText = ""; alertOkCallback = null; alertCancelCallback = null; } GUILayout.FlexibleSpace(); if (GUILayout.Button("OK", GUILayout.Width(100), GUILayout.Height(70))) { if (alertOkCallback != null) alertOkCallback(); else GuiState = LastGuiState; alertText = ""; alertOkCallback = null; alertCancelCallback = null; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.enabled = false; }
public void ShowAlertWindow(string title, string text, AlertCallback okCallback, AlertCallback cancelCallback) { GuiState = RuleGUIState.ALERT; alertTitle = title; alertText = text; alertOkCallback = okCallback; alertCancelCallback = cancelCallback; }
/// <summary> /// Stab. /// </summary> public static void RegisterToBuiltIns(AlertCallback callback) { }
public static void Show(string message, AlertCallback callback = null) { s_instance.text.text = message; s_instance.callback = callback; s_instance.m_view.gameObject.SetActive(true); }
public static void DisplayAlertDelegate(string title, string message, string[] options, AlertCallback del) { DisplayAlert(title, message, new DelegateAlertDelegate(del), options); }
public DelegateAlertDelegate(AlertCallback cb) { this.cb = cb; }