private static string _filename = ""; // There will be one instance of this per type
#pragma warning restore RECS0108              // Warns about static fields in generic types


        /// <summary>
        /// Load config file
        /// </summary>
        /// <param name="filename">Path to file</param>
        /// <returns>Returns true if default config was used</returns>
        public bool Load(string filename)
        {
            _filename = filename;

            var result = FileInteractor.Load <T>(filename);

            config = result.Value;

            return(result.Key);
        }
 /// <summary>
 /// Save config file
 /// </summary>
 public void Save()
 {
     FileInteractor.Save(_filename, config);
 }
 /// <summary>
 /// Reload config file
 /// </summary>
 public void Reload()
 {
     config = FileInteractor.Load <T>(_filename).Value;
 }
Exemple #4
0
 public SystemPersistence(FileInteractor context)
 {
     this.context = context;
 }
 /// <summary>
 /// Save config file
 /// </summary>
 public static void Save()
 {
     FileInteractor.Save(_filename, Config);
 }