public MainWindow() { InitializeComponent(); var apps = EnumHelper.GetList(typeof(ApplicationEnum)); this.ApplicationComboBox.ItemsSource = apps; this.ApplicationComboBox.DisplayMemberPath = "Value"; this.ApplicationComboBox.SelectedValuePath = "Key"; this.ApplicationComboBox.SelectedIndex = 0; var editions = EnumHelper.GetList(typeof(EditionEnum)); this.EditionComboBox.ItemsSource = editions; this.EditionComboBox.DisplayMemberPath = "Value"; this.EditionComboBox.SelectedValuePath = "Key"; this.EditionComboBox.SelectedIndex = 0; var countries = EnumHelper.GetList(typeof(CountryEnum)); this.CountryComboBox.ItemsSource = countries; this.CountryComboBox.DisplayMemberPath = "Value"; this.CountryComboBox.SelectedValuePath = "Key"; this.CountryComboBox.SelectedIndex = 0; this.ExpireDatePicker.SelectedDate = DateTime.Now.AddMonths(1); this.SerialCodeTextBox.Text = MachineKey.Create().Key; }
public RegistrationWindow(DateTime expireDate) { InitializeComponent(); this._expireDate = expireDate; if (this._expireDate < DateTime.Now) { this.TrialButton.Visibility = System.Windows.Visibility.Collapsed; this.CancelButton.Visibility = System.Windows.Visibility.Visible; this.TitleTextBlock.Text = "Application has expired."; } else { this.TrialButton.Visibility = System.Windows.Visibility.Visible; this.CancelButton.Visibility = System.Windows.Visibility.Collapsed; this.TitleTextBlock.Text = string.Format("License will expire in {0} day(s).", (expireDate - DateTime.Now.Date).Days); } this.SerialNumberTextBox.Text = MachineKey.Create().Key; }
private void btnGetKeys_Click(object sender, EventArgs e) { this.txtKeys.Text = $"DecryptionKey:{MachineKey.Create(24)}{Environment.NewLine}ValidationKey:{MachineKey.Create(64)}"; }