static SaveSystemSettings()
 {
     lock (@lock)
     {
         DefaultStorage = StorageFactory.DefaultStorage;
         DefaultJsonSerializerSettings = JsonSerializerSettingsPreset.DefaultPreset.NewSettings;
         DefaultSerializer             = new SaveSystemJsonSerializer(DefaultJsonSerializerSettings);
         DefaultUseEncryption          = false;
         DefaultEncryptionAlgorithm    = new SaveSystemSymmetricEncryption();
         DefaultPassword = "******";
         if (SaveSystemSettingsPreset.DefaultPreset != null)
         {
             DefaultSettings = SaveSystemSettingsPreset.DefaultPreset.CustomSettings;
         }
         else
         {
             DefaultSettings = new SaveSystemSettings()
             {
                 Storage             = DefaultStorage,
                 Serializer          = DefaultSerializer,
                 UseEncryption       = DefaultUseEncryption,
                 EncryptionAlgorithm = DefaultEncryptionAlgorithm,
                 Password            = DefaultPassword
             };
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// Applies the preset settings to the <see cref="SaveSystemSettings"/> instance.
        /// </summary>
        /// <param name="settings"></param>
        public virtual void ApplyTo(SaveSystemSettings settings)
        {
            JsonSerializerSettingsPreset serializerSettingsPreset = this.serializerSettingsPreset ?? JsonSerializerSettingsPreset.DefaultPreset;

            settings.Serializer          = new SaveSystemJsonSerializer(serializerSettingsPreset.NewSettings);
            settings.Storage             = StorageFactory.FromConnectionString(this.storageConnectionString);
            settings.Storage.UseMetaData = this.useMetaData;
            settings.Storage.UseCatalog  = this.useCatalog;
            settings.UseEncryption       = this.useEncryption;
            settings.EncryptionAlgorithm = new SaveSystemSymmetricEncryption(this.ecryptionAlgorithmName);
            settings.Password            = this.password;
        }