예제 #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();
            }
        }
예제 #2
0
 /// <summary>
 /// Clears all Exam Informations and reloads them from the Web
 /// </summary>
 private async Task ProceedLogin()
 {
     await ObserverHandler.LoginAsync();
 }