Encapsulates dialog functionality from the Credential Management API.
コード例 #1
0
ファイル: Auth.cs プロジェクト: InFlowBPM/InFlow-BPMS
        public static bool Login(string name)
        {
            bool value = false;

            try
            {
                dialog = new CredentialsDialog("InFlow Outlook Add-In");
                //dialog.Persist = true;

                if (name != null)
                {
                    dialog.AlwaysDisplay = true;               // prevent an infinite loop
                }
                if (dialog.Show(name) == DialogResult.OK)
                {
                    if (Authenticate(dialog.Name, dialog.Password))
                    {
                        value = true;
                        if (dialog.SaveChecked)
                        {
                            dialog.Confirm(true);
                        }
                    }
                    else
                    {
                        try
                        {
                            dialog.Confirm(false);
                        }
                        catch (ApplicationException applicationException)
                        {
                            // exception handling ...
                        }
                        value = Login(dialog.Name); // need to find a way to display 'Logon unsuccessful'
                    }
                }
            }
            catch (ApplicationException applicationException)
            {
                // exception handling ...
            }
            return(value);
        }