예제 #1
0
 internal void Refresh()
 {
     _licenseEntry           = LicenseEntry.Load();
     UserInfo                = GetUserInfo(_licenseEntry.Name, _licenseEntry.Company);
     UserEmail               = _licenseEntry.Email;
     IsMachineLicenseEnabled = _licenseEntry.RuntimeLicense != null;
     RefreshLicenseState();
     RefreshLicenseItems();
 }
예제 #2
0
        public static void Show(Window ownerWindow, string assemblyPath, string assemblyData)
        {
            LicenseEntry        licenseEntry = LicenseConsoleData.Singleton.LicenseEntry;
            NameValueCollection parameters   = PrepareParameters(LicenseType.Distributable, licenseEntry.LicenseKey, licenseEntry.Name, licenseEntry.Company, assemblyData);

            parameters.Add("AssemblyPath", assemblyPath);
            parameters.Add("LicenseCategory", LicenseConsoleData.GetLicenseCategory(LicenseType.Distributable));
            Show(ownerWindow, parameters);
        }
예제 #3
0
 private static void LoadDisabledRuntimeLicense(LicenseEntry licenseEntry)
 {
     if (File.Exists(DisabledRuntimeLicenseFile))
     {
         var licenseString = File.ReadAllText(DisabledRuntimeLicenseFile);
         licenseEntry._disabledRuntimeLicenseString = licenseString;
         licenseEntry._disabledRuntimeLicense       = GetLicense(licenseString);
     }
 }
예제 #4
0
        public static LicenseEntry Load()
        {
            LicenseEntry result = new LicenseEntry();

            if (File.Exists(LicenseInfoFile))
            {
                var serializer = new XmlSerializer(typeof(LicenseInfo));
                using (var reader = XmlTextReader.Create(new StringReader(File.ReadAllText(LicenseInfoFile))))
                {
                    var info = (LicenseInfo)serializer.Deserialize(reader);
                    result._licenseKey = DecryptLicenseKey(info.LicenseKey);
                    result._name       = info.Name;
                    result._company    = info.Company;
                    result._email      = info.Email;
                }
            }

            LoadRuntimeLicense(result);
            LoadDisabledRuntimeLicense(result);

            return(result);
        }
예제 #5
0
 public void ToggleRuntimeLicense()
 {
     LicenseEntry.ToggleRuntimeLicense();
     Refresh();
 }
예제 #6
0
 internal void SaveProductLicense(LicenseKey licenseKey, string userName, string company, string email, string designTimeLicense, string runtimeLicense)
 {
     LicenseEntry.Save(licenseKey, userName, company, email, designTimeLicense, runtimeLicense);
     Refresh();
 }