//Checks a newly entered license key private void checkLicenseKeyButton_Click(object sender, EventArgs e) { string licenseKey = licenseKeyTextBox.Text; LicenseCheck.storeLicenseKey(licenseKey); setLicenseMessages(licenseKey); }
public MainWindow() { InitializeComponent(); //Set the version number label to the current version this.versionNumberLabel.Text = "v " + ApplicationUpdater.getCurrentProductVersion(); //Get a previously stored licensekey and check if it is valid string licenseKey = LicenseCheck.getStoredLicenseKey(); if (licenseKey != null) { setLicenseMessages(licenseKey); } //Activate the file watchers Task.Factory.StartNew(() => MainMethods.activateFileWatchers()); //Start the timer that updates the console fileWatcherStatusUpdateTimer.Tick += updateHUDStatus; fileWatcherStatusUpdateTimer.Interval = 1500; fileWatcherStatusUpdateTimer.Start(); errorMessage.Click += MainMethods.openQuickStartGuide; }
//Checks, if a license key is valid and sets all TextBoxes accordingly private void setLicenseMessages(string licenseKey) { licenseKeyStatusLabel.Text = "Checking License Key..."; licenseKeyTextBox.Text = licenseKey; if (LicenseCheck.isLicenseValid(licenseKey)) { licenseKeyStatusLabel.Text = "You are using the pro version!"; hasLicense = true; buyButton.Visible = false; buyMessage.Text = "May the flop be with you!"; checkLicenseKeyButton.Text = "Thank you"; } else { licenseKeyStatusLabel.Text = "License Key is not valid!"; hasLicense = false; } }