예제 #1
0
        private void Delete()
        {
            QuestionForm frm = new QuestionForm();

            frm.Msg = "Delete this job?";
            if (frm.ShowDialog() == DialogResult.OK)
            {
                DataGridViewRow row = GetSelectedRowFromCell(gridJobs);
                if (row == null)
                {
                    return;
                }
                gridJobs.Rows.Remove(row);
                if (row.Cells[0].Value == null)
                {
                    //RefreshFiles();
                    ClearFiles();
                    return;
                }
                string       name      = row.Cells[0].Value.ToString();
                JobsBO       bo        = (JobsBO)SingletonManager.GetSingleton(typeof(JobsBO));
                JobContainer container = bo.FindByName(name);
                if (container != null)
                {
                    bo.Delete(container);
                    bo.Save();
                    //RefreshFiles();
                }
            }
        }
예제 #2
0
        public void Move(IGame game)
        {
            var questionResult = new QuestionResultDto();
            var questionForm   = new QuestionForm(questionResult, game.LabelCurrentNode);

            questionForm.ShowDialog();
            game.Play(questionResult.Result);
        }
예제 #3
0
        private bool MatchWarn()
        {
            QuestionForm frm = new QuestionForm();

            frm.Msg = "WARNING:  This process can delete files from your backup.  " +
                      "It will remove any files or folders that do not currently exist in your source directory(s).\n\n" +
                      "Are you sure you want to proceed?";
            return(DialogResult.OK == frm.ShowDialog());
        }
예제 #4
0
        public void AttemptLicense()
        {
            EncryptedLicenseProvider provider = new EncryptedLicenseProvider();
            EncryptedLicense         license  = provider.GetLicense(LicenseBO.ValidationParameters, GetLicenseFile());

            if (license != null)
            {
                MessageForm frm = new MessageForm();
                frm.Msg = "Your license is installed properly.  No further licensing is required.";
                frm.ShowDialog();
                return;
            }
            else
            {
                LicenseForm licfrm = new LicenseForm();
                license = licfrm.ShowDialog("Llama Carbon Copy", Properties.Settings.Default.Website, LicenseBO.GetLicenseFile());
                if (licfrm.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
                if (license != null)
                {
                    //congratulate
                    OnLicensed(EventArgs.Empty);
                    MessageForm frm = new MessageForm();
                    frm.Msg = "You have successfully installed your license.";
                    frm.ShowDialog();
                }
                else
                {
                    //ask if they want to try again
                    QuestionForm frm = new QuestionForm();
                    frm.Msg = "There was a problem creating your license.  Would you like to try again?";
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        AttemptLicense();
                    }
                }
            }
        }
예제 #5
0
        public bool IsActive()
        {
            EncryptedLicenseProvider provider = new EncryptedLicenseProvider();
            EncryptedLicense         license  = provider.GetLicense(LicenseBO.ValidationParameters, GetLicenseFile());

            if (license == null)
            {
                EvaluationMonitor monitor = new EvaluationMonitor("SpittingImage");
                if (monitor.DaysInUse > 15 || monitor.Invalid)
                {
                    QuestionForm frm = new QuestionForm();
                    frm.Msg = "Your trial license has expired.  Would you like to enter a license key to activate the software?";
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        LicenseForm licfrm = new LicenseForm();
                        license = licfrm.ShowDialog("Llama Carbon Copy", Properties.Settings.Default.Website, LicenseBO.GetLicenseFile());
                        if (license != null)
                        {
                            OnLicensed(EventArgs.Empty);
                        }
                    }
                }
                else
                {
                    MessageForm frm = new MessageForm();
                    frm.Msg = string.Format("You are on day {0} of your 15 day evaluation.", monitor.DaysInUse);
                    frm.ShowDialog();
                    return(true);
                }
            }
            if (license == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
    // skipped constructor and controls
    public static int ShowQuestion(string q, string a1, string a2, string a3, int correct)
    {
        QuestionForm f = new QuestionForm();

        f.qtnlabel.Text   = q;
        f.radbtnans1.Text = a1;
        f.radbtnans2.Text = a2;
        f.radbtnans3.Text = a3;
        f.ShowDialog(owner);
        if (f.radbtnans1.Checked)
        {
            return(0);
        }
        else if (f.radbtnans2.Checked)
        {
            return(1);
        }
        else if (f.radbtnans3.Checked)
        {
            return(2);
        }
    }