Example #1
0
 public static bool ShowExpireMessage()
 {
     if (MessageBox.Show("Your version of PAT is expired. Simulation and verification functions in PAT are disabled. Do you want to purchase the full version?", "Registration", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
     {
         RegisterationForm form = new RegisterationForm();
         form.ShowDialog();
         return(true);
     }
     return(false);
 }
Example #2
0
 public static bool ShowEvaluationMessage()
 {
     if (MessageBox.Show("You are running an evaluation version of PAT. Do you want to purchase the full version?", "Registration", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
     {
         RegisterationForm form = new RegisterationForm();
         form.ShowDialog();
         return(true);
     }
     return(false);
 }
Example #3
0
        private void RegisterationForm_Load(object sender, EventArgs e)
        {
            //TextBox_HardwareCode.Text = License.Status.GetHardwareID(true, true, false, false);
            TextBox_HardwareCode.Text = License.Status.HardwareID;

            if (IsValidLicenseAvailable() == Ultility.LicenseType.Valid)
            {
                Label_Register.Text          = "Your copy of PAT is registered!";
                this.Button_Purchase.Enabled = false;

                if (License.Status.Evaluation_Lock_Enabled)
                {
                    Label_ValidTime.Text = string.Format("{0} days of {1} days",
                                                         RegisterationForm.CurrentEvaluationDays(),
                                                         RegisterationForm.TotalEvaluationDays());
                }
                else if (License.Status.Expiration_Date_Lock_Enable)
                {
                    Label_ValidTime.Text = License.Status.Expiration_Date.ToShortDateString();
                }
            }

            try
            {
                for (int i = 0; i < License.Status.KeyValueList.Count; i++)
                {
                    string key   = License.Status.KeyValueList.GetKey(i).ToString();
                    string value = License.Status.KeyValueList.GetByIndex(i).ToString();

                    if (key == "User")
                    {
                        Label_RegisteredUser.Text = value;
                    }
                    //MessageBox.Show(key + " " + value);
                }
            }
            catch (Exception)
            {
                Label_RegisteredUser.Text = "";
            }
        }