using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace TJAPlayer3 { class CSavableT where T : new() { public virtual string _fn { get; protected set; } public void tDBInitSavable() { if (!File.Exists(_fn)) tSaveFile(); tLoadFile(); } public T data = new T(); #region [private] private void tSaveFile() { ConfigManager.SaveConfig(data, _fn); } private void tLoadFile() { data = ConfigManager.GetConfig(_fn); } #endregion } }