protected virtual void DispatchEvent(FileSystemEventArgs e) { EventHandler <SavedFileChangedEventArgs> handler = SavedFileChanged; if (handler != null) { var args = new SavedFileChangedEventArgs(); args.fileEvent = e; args.TimeReached = DateTime.Now; handler(this, args); } }
public void SaveFileChanged(SavedFileChangedEventArgs e) { lock (obj) { if (TimeElapsedSinceLastEvent(e.TimeReached)) { Logger.Log("{0} Backing up save updated at {1}", DateTime.Now, e.TimeReached); FileSystemEventArgs fileEvent = e.fileEvent; string saveFilePath = fileEvent.FullPath; CreateBackupCopy(saveFilePath); Thread.Sleep(5000); lastFired = DateTime.Now; } } }
private void OnSaveFileChanged(object sender, SavedFileChangedEventArgs e) { saveFileBackupProcess.SaveFileChanged(e); }