private async Task<bool> DisplayLoginWindow()
        {
            // Display Login
            Hide();
            LoginForm loginForm = new LoginForm();
            loginForm.ShowDialog();                        

            // Check if an Option was Selected
            if (!loginForm.loginSelected)
                throw new LoginNotSelectedException("Login information was not provided. Unable to start bot without this information.");

            // Display Console
            console.Show();

            // Display the Main Window
            Show();

            // Determine Login Method
            if (loginForm.auth == AuthType.Ptc)
                await LoginPtc(loginForm.boxUsername.Text, loginForm.boxPassword.Text);
            if (loginForm.auth == AuthType.Google)
                await LoginGoogle(loginForm.boxUsername.Text, loginForm.boxPassword.Text);            

            // New Login Notification
            // Notify the API (Pending)

            // Select the Location
            Logger.Write("Select Starting Location...");

            // Close the Login Form
            loginForm.Close();

            // Check if Login was Successful
            if (_loginSuccess)
                return true;
            else
                return false;
        }
        private async Task displayLoginWindow()
        {
            // Display Login
            this.Hide();
            LoginForm loginForm = new LoginForm();
            loginForm.ShowDialog();
            this.Show();

            // Check if an Option was Selected
            if (!loginForm.loginSelected)
                Application.Exit();

            // Determine Login Method
            if (loginForm.auth == AuthType.Ptc)
                await loginPtc(loginForm.boxUsername.Text, loginForm.boxPassword.Text);
            if (loginForm.auth == AuthType.Google)
                await loginGoogle();

            // Select the Location
            Logger.Write("Select Starting Location...");

            // Close the Login Form
            loginForm.Close();
        }
Exemple #3
0
        private async Task DisplayLoginWindow()
        {
            // Display Login
            Hide();
            LoginForm loginForm = new LoginForm();
            loginForm.ShowDialog();                        

            // Check if an Option was Selected
            if (!loginForm.loginSelected)
                throw new LoginNotSelectedException("Login information was not provided. Unable to start bot without this information.");

            // Display Console
            console.Show();

            // Display the Main Window
            Show();

            // Determine Login Method
            if (loginForm.auth == AuthType.Ptc)
                await LoginPtc(loginForm.boxUsername.Text, loginForm.boxPassword.Text);
            if (loginForm.auth == AuthType.Google)
                await LoginGoogle(loginForm.boxUsername.Text, loginForm.boxPassword.Text);

            // New Login Notification
            APINotifications.SendNotification($"Using {loginForm.auth} with version {typeof(MainForm).Assembly.GetName().Version}", "New Login", 0);

            // Select the Location
            Logger.Write("Select Starting Location...");

            // Close the Login Form
            loginForm.Close();
        }