Esempio n. 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();
            this.ActivationCode.Text = activation.GetActivationCode();

             ActivationManager am = ActivationManager.GetInstance();

             this.Key.Text = am.GetKey();

            if (am.ActivationStatus())
            {
                this.lbl_left.Visibility = Visibility.Collapsed;
                this.Key.IsEnabled = false;
                this.RegisterButtonsPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                int daysleft = 30 - am.CountDays();

                if (daysleft > 0)
                {
                    this.lbl_left.Content = "Unregistered version you have " + daysleft.ToString() + " days left";
                }
                else
                {
                    this.lbl_left.Content = "Please register you have used your 30 days trial period";
                }

            }
        }
Esempio n. 2
0
        public bool ActivationStatus()
        {
            Activation activation = new Activation();

            string key = SettingsManager.ReadSetting("ActivationKey");

            string code = activation.GetActivationCode();

            string correctkey = activation.ThisComputerKey();

            if (correctkey == key)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Esempio n. 3
0
        private void VerifyKey_Click(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();

            string correctkey = activation.ThisComputerKey();

            string key = this.Key.Text;

            if (key == correctkey)
            {
                SettingsManager.UpdateSetting("ActivationKey", key);
                MessageBox.Show("Activation Successful");
                this.Close();
            }
            else
            {
                MessageBox.Show("The key is wrong, try again...");
            }
        }
Esempio n. 4
0
        public string GetKey()
        {
            Activation activation = new Activation();

            return SettingsManager.ReadSetting("ActivationKey");
        }
Esempio n. 5
0
        private void Generate_Click(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();

            this.Key.Text=activation.GenerateKeyFromCode(this.ActivationCode.Text);
        }