예제 #1
0
파일: License.cs 프로젝트: modulexcite/QSet
		/// <summary>
		/// Displays a form for the user to edit the current license.
		/// </summary>
		/// <exception cref="LicenseSaveException">Occurs when the users inputs a valid license, but the license could not be saved to disk.</exception>
		public void EditLicense()
		{
			LicenseForm licenseForm = null;
			
			try
			{
				licenseForm = new LicenseForm(new LicenseForm.IsActivationKeyValid(IsActivationKeyValid));

				if (licenseForm.ShowDialog() == DialogResult.OK)
				{
					RegistrationEmail = licenseForm.RegistrationEmail;
					ActivationKey = licenseForm.ActivationKey;
					UpdateLicenseState();			
					PersistLicenseToDisk();
				}
			}
			finally
			{
				if (licenseForm != null)
					licenseForm.Dispose();
			}
		}