public AutoSaveManager(string extension, string defDirectory, int interval, int changesCount, Saver saver, object objectToSave) { Extension = extension; DefaultDirectory = defDirectory; TimerInterval = interval; ChangesToSaveCount = changesCount; _timer = new Timer(AutoSave, null, TimerInterval * 1000, TimerInterval * 1000); _saver = saver; ObjectToSave = objectToSave; Enabled = true; }
public void Save(string fileName, Saver saver, object toSave) { saver.Save(fileName, toSave); OnSave(new SaveEventArgs(fileName)); }
public object Open(string fileName, Saver saver) { return(saver.Open(fileName)); }