Beispiel #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            GlobalSettings.Pages.BeginEdit();
            GlobalSettings.Pages.General().AskWhenUploadUsageStats = false;
            GlobalSettings.Pages.General().AllowUploadUsageStats   = chbAllowUploadStats.Checked;
            GlobalSettings.Pages.EndEdit();

            if (rbtPersonal.Checked)
            {
                InstallationInfo.Instance.InstallMode = InstallationMode.Personal;
            }
            if (rbtProfessional.Checked)
            {
                InstallationInfo.Instance.InstallMode = InstallationMode.Professional;
            }
            InstallationInfo.Instance.LastShown = DateTime.UtcNow;
            InstallationInfo.Instance.Save();

            if (grpEval.Enabled && (chbDataSynEval.Checked || chbProEval.Checked || chbVersionDbEval.Checked))
            {
                var evdata = GetEvalCodeForm.Run();
                if (evdata == null)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
                int cnt = 0;
                using (var wc = new WaitContext())
                {
                    if (chbDataSynEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "datasyn"))
                    {
                        cnt++;
                    }
                    if (chbProEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "pro"))
                    {
                        cnt++;
                    }
                    if (chbVersionDbEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "versiondb"))
                    {
                        cnt++;
                    }
                }
                if (cnt > 0)
                {
                    LicenseTool.ReloadLicenses();
                    HLicense.CallChangedLicenses();
                    StdDialog.ShowInfo("s_license_succesfuly_installed");
                }
                else
                {
                    StdDialog.ShowError("s_error_when_install_license");
                }
            }
            Close();
        }
Beispiel #2
0
        public static Result Run()
        {
            var win = new GetEvalCodeForm();

            if (win.ShowDialogEx() == DialogResult.OK)
            {
                return(new Result
                {
                    Name = win.tbxName.Text,
                    Email = win.tbxEmail.Text,
                });
            }
            return(null);
        }