Exemplo n.º 1
0
 internal void Refresh()
 {
     _licenseEntry           = LicenseEntry.Load();
     UserInfo                = GetUserInfo(_licenseEntry.Name, _licenseEntry.Company);
     UserEmail               = _licenseEntry.Email;
     IsMachineLicenseEnabled = _licenseEntry.RuntimeLicense != null;
     RefreshLicenseState();
     RefreshLicenseItems();
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 private static void LoadDisabledRuntimeLicense(LicenseEntry licenseEntry)
 {
     if (File.Exists(DisabledRuntimeLicenseFile))
     {
         var licenseString = File.ReadAllText(DisabledRuntimeLicenseFile);
         licenseEntry._disabledRuntimeLicenseString = licenseString;
         licenseEntry._disabledRuntimeLicense       = GetLicense(licenseString);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public void ToggleRuntimeLicense()
 {
     LicenseEntry.ToggleRuntimeLicense();
     Refresh();
 }
Exemplo n.º 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();
 }