コード例 #1
0
        public static void Unlock()
        {
            using (Unlock form = new Unlock())
            {
                var result = form.ShowDialog();

                if (result == DialogResult.OK)
                {
                    if (!ValidatePassword(form.PasswordInput))
                    {
                        Unlock();
                        return;
                    }

                    _password = form.PasswordInput;
                }
                else if (result == DialogResult.Abort)
                {
                    if (MainService.ConfirmReset())
                    {
                        MainService.Reset();
                    }
                    else
                    {
                        Unlock();
                    }
                }
                else
                {
                    Application.Exit();
                }
            }
        }