public static void RegisterLicenseFromAppSettings(IAppSettings appSettings) { //Automatically register license key stored in <appSettings/> var licenceKeyText = appSettings.GetString(NetStandardPclExport.AppSettingsKey); if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); } }
public static void RegisterLicenseFromFile(string filePath) { if (!filePath.FileExists()) { throw new LicenseException("License file does not exist: " + filePath).Trace(); } var licenseKeyText = filePath.ReadAllText(); LicenseUtils.RegisterLicense(licenseKeyText); }
public static void RegisterLicenseFromFileIfExists(string filePath) { if (!filePath.FileExists()) { return; } var licenseKeyText = filePath.ReadAllText(); LicenseUtils.RegisterLicense(licenseKeyText); }
public override void RegisterLicenseFromConfig() { //Automatically register license key stored in <appSettings/> is done in .NET Core AppHost //or SERVICESTACK_LICENSE Environment variable var licenceKeyText = GetEnvironmentVariable(EnvironmentKey)?.Trim(); if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); } }
public override void RegisterLicenseFromConfig() { #if ANDROID #elif __IOS__ #elif __MAC__ #elif NETSTANDARD2_0 #else string licenceKeyText; try { //Automatically register license key stored in <appSettings/> licenceKeyText = ConfigurationManager.AppSettings[AppSettingsKey]; if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); return; } } catch (Exception ex) { licenceKeyText = Environment.GetEnvironmentVariable(EnvironmentKey)?.Trim(); if (string.IsNullOrEmpty(licenceKeyText)) { throw; } try { LicenseUtils.RegisterLicense(licenceKeyText); } catch { throw ex; } } //or SERVICESTACK_LICENSE Environment variable licenceKeyText = Environment.GetEnvironmentVariable(EnvironmentKey)?.Trim(); if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); } #endif }
public override void RegisterLicenseFromConfig() { string licenceKeyText; try { //Automatically register license key stored in <appSettings/> licenceKeyText = System.Configuration.ConfigurationManager.AppSettings[AppSettingsKey]; if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); return; } } catch (NotSupportedException) { return; } // Ignore Unity/IL2CPP Exception catch (Exception ex) { licenceKeyText = Environment.GetEnvironmentVariable(EnvironmentKey)?.Trim(); if (string.IsNullOrEmpty(licenceKeyText)) { throw; } try { LicenseUtils.RegisterLicense(licenceKeyText); } catch { throw ex; } } //or SERVICESTACK_LICENSE Environment variable licenceKeyText = Environment.GetEnvironmentVariable(EnvironmentKey)?.Trim(); if (!string.IsNullOrEmpty(licenceKeyText)) { LicenseUtils.RegisterLicense(licenceKeyText); } }
public static void RegisterLicense(string licenseKeyText) { LicenseUtils.RegisterLicense(licenseKeyText); }