Exemple #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void LoginEmail(string emailAddress)
        {
            BeginInvoke(new Action(() =>
            {
                loadingPictureBox.Visible = true;
                loadingPictureBox.StartAnimation();
            }));

            EventWaitHandle wait = new EventWaitHandle(false, EventResetMode.ManualReset);

            SlackClient.StartAuth((r) =>
            {
                if (r.ok)
                {
                    authResponse(r);
                }
                wait.Set();
            }, emailAddress);
            wait.WaitOne();
            BeginInvoke(new Action(() =>
            {
                loadingPictureBox.StopAnimation();
                loadingPictureBox.Visible = false;
            }));
        }
Exemple #2
0
        void ProcessAuth(string password)
        {
            BeginInvoke(new Action(() =>
            {
                loadingAnimation.Visible = true;
                loadingAnimation.StartAnimation();
            }));

            EventWaitHandle wait = new EventWaitHandle(false, EventResetMode.ManualReset);

            SlackClient.AuthSignin((s) =>
            {
                if (!s.ok)
                {
                    wait.Set();
                    return;
                }

                try
                {
                    onPasswordAuth(s.token);
                }
                finally
                {
                    wait.Set();
                }
            }, combo.user_id, combo.team_id, password);
            wait.WaitOne();

            BeginInvoke(new Action(() =>
            {
                loadingAnimation.Visible = false;
                loadingAnimation.StopAnimation();

                signin.Enabled = true;
            }));
        }