Exemplo n.º 1
0
 /// <summary>
 ///     Saves the config
 /// </summary>
 public void Save()
 {
     if (ConfigFileLocation.IsNullOrEmpty())
     {
         return;
     }
     Encrypt();
     new FileInfo(ConfigFileLocation).Save(ObjectToString(this));
     Decrypt();
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Loads the config
        /// </summary>
        public void Load()
        {
            if (ConfigFileLocation.IsNullOrEmpty())
            {
                return;
            }
            string fileContent = new FileInfo(ConfigFileLocation).Read();

            if (string.IsNullOrEmpty(fileContent))
            {
                Save();
                return;
            }
            LoadProperties(StringToObject(fileContent));
            Decrypt();
        }