Beispiel #1
0
        /// <summary>
        /// Initial check for existing configuration and initializting the
        /// <see cref="ObserverHandler"/>.
        /// </summary>
        private void Initialize()
        {
            bool configured = CheckConfig();

            if (configured == false)
            {
                if (MetroMessageBox.ShowMessage("Bitte gib zuerst deine Daten ein!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                {
                    metroTabControl1.SelectedIndex = 1;
                }
            }
            else
            {
                UpdateStatusLabel("Configuring Observer");

                ObserverHandler.ConfigureUrls(_welcome, _login, _results);
                ObserverHandler.ConfigureCredentials(new Observer.Classes.Credentials(Properties.Settings.Default.Identifikationsnummer, Properties.Settings.Default.Prüfungsnummer));

                UpdateStatusLabel("Subscribe Observer");

                ObserverHandler.OnCaptchaReceived          += ObserverHandler_OnCaptchaReceived;
                ObserverHandler.OnCaptchaSolvedReceived    += ObserverHandler_OnCaptchaSolvedReceived;
                ObserverHandler.OnLoginStatusReceived      += ObserverHandler_OnLoginStatusReceived;
                ObserverHandler.OnExamsInformationReceived += ObserverHandler_OnExamsInformationReceived;

                UpdateStatusLabel("Trying to Login");

                StartMarksLoading();
            }
        }
Beispiel #2
0
 public void Show(string title, string message)
 {
   var metroMessageBox = new MetroMessageBox();
   metroMessageBox.ShowMessage(title, message);
 }