Ejemplo n.º 1
0
 /// <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;
     }
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 public void RegisterAlertCallback(AlertCallback func)
 {
     alertCallback += func;
 }
Ejemplo n.º 4
0
    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;
    }
Ejemplo n.º 5
0
 public void ShowAlertWindow(string title, string text, AlertCallback okCallback, AlertCallback cancelCallback)
 {
     GuiState = RuleGUIState.ALERT;
     alertTitle = title;
     alertText = text;
     alertOkCallback = okCallback;
     alertCancelCallback = cancelCallback;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Stab.
 /// </summary>
 public static void RegisterToBuiltIns(AlertCallback callback)
 {
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public static void DisplayAlertDelegate(string title, string message, string[] options, AlertCallback del)
 {
     DisplayAlert(title, message, new DelegateAlertDelegate(del), options);
 }
Ejemplo n.º 9
0
 public DelegateAlertDelegate(AlertCallback cb)
 {
     this.cb = cb;
 }