Пример #1
0
        void ResetEmailtoDefault()
        {
            var keycodeInputForm = new KeycodeInputForm();

            keycodeInputForm.keycodeLabel.Text = "To Reset Enter KeyCode";
            keycodeInputForm.isReset           = true;
            var dialogResult = keycodeInputForm.ShowDialog();

            if (keycodeInputForm.promptMessage.Text == string.Empty && dialogResult != DialogResult.Cancel)
            {
                var resetConfirmationForm = new ResetConfirmationForm();
                var dialogResetReset      = resetConfirmationForm.ShowDialog();

                if (dialogResetReset == DialogResult.Yes)
                {
                    var resetsuccessfulForm = new ResetSuccessfulForm();
                    resetsuccessfulForm.ShowDialog();

                    emailListUserControl.removeAllEmailfromList();
                    emailListUserControl.addAllEmailtoList();

                    resetsuccessfulForm.Dispose();
                }
                resetConfirmationForm.Dispose();
            }

            else if (dialogResult == DialogResult.Cancel)
            {
                keycodeInputForm.Dispose();
            }
        }
Пример #2
0
        void AddEmailListPanelVisible()
        {
            if (initalEmailCopy)
            {
                var keycodeInputForm = new KeycodeInputForm();
                keycodeInputForm.keycodeLabel.Text = "Enter KeyCode";
                keycodeInputForm.isReset           = false;
                var dialogResult = keycodeInputForm.ShowDialog();

                //if promptMessage is empty this means that no error was thrown
                if (keycodeInputForm.promptMessage.Text == string.Empty && dialogResult != DialogResult.Cancel)
                {
                    initalEmailCopy        = false;
                    logUserControl.Visible = false;
                    emailListUserControl.BringToFront();
                    emailListUserControl.Visible = true;
                }

                else if (dialogResult == DialogResult.Cancel)
                {
                    keycodeInputForm.Dispose();
                }
            }
            else if (emailListUserControl.Visible == false)
            {
                logUserControl.Visible = false;
                emailListUserControl.BringToFront();
                emailListUserControl.Visible = true;

                ChangePreviewPanelEnable(false);
            }
            else
            {
                emailListUserControl.Visible = false;
                ChangePreviewPanelEnable(true);
            }
        }