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"; } } }
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; } }