コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
 private void OnSaveFileChanged(object sender, SavedFileChangedEventArgs e)
 {
     saveFileBackupProcess.SaveFileChanged(e);
 }