internal License(int level, int subLevel, Color color, int iRating)
 {
     SafetyRating  = subLevel / 100F;
     Level         = GetLevel(level);
     Order         = (int)Level.Level * 1000 + subLevel;
     _licenseColor = color;
     IRating       = iRating;
 }
        /// <summary>
        /// Generate an encrypted version key based on the current version and the specified <paramref name="licenseLevel" />.
        /// This code can be used to generate AppSetting.VersionKey values.
        /// </summary>
        /// <param name="licenseLevel">The license level.</param>
        /// <returns>System.String.</returns>
        public static string GenerateEncryptedVersionKey(LicenseLevel licenseLevel)
        {
            var version = GalleryDataSchemaVersionEnumHelper.ConvertGalleryDataSchemaVersionToString(HelperFunctions.GetGalleryServerVersion());
            var key     = new Entity.VersionKey()
            {
                ProductId = licenseLevel, Version = version
            };
            var keyJson = JsonConvert.SerializeObject(key);

            return(Utils.Encrypt(keyJson, GlobalConstants.ENCRYPTION_KEY));
        }
 public ContextConfigExtended()
     : base()
 {
     licenses             = new System.Collections.Generic.Dictionary <string, LicenseLevel>();
     licenseLevelInternal = LicenseLevel.NONE;
 }
 private static LicenseLevel GetLevel(int level)
 {
     return(LicenseLevel.FromLevel(level));
 }