Beispiel #1
0
        //https://stackoverflow.com/a/721743
        public FileWatcher(string filePath, IFileModel model, IFileModelView modelView, bool enabled = true, FileWatcherService service = null)
        {
            Model = model;
            Stamp = model is IStampKey stamp ? (stamp.Stamp ?? File.GetLastWriteTimeUtc(filePath)) : File.GetLastWriteTimeUtc(filePath);

            ModelView = modelView;
            FilePath  = filePath;
            Service   = service ?? FileWatcherService.Instance;
            Enabled   = enabled;
        }
Beispiel #2
0
 //https://stackoverflow.com/a/721743
 public FileWatcher(string filePath, IFileModel model, object modelView, bool enabled = true, FileWatcherService service = null)
 {
     Model      = model;
     ModelToken = model?.Token ?? 0;
     ModelView  = modelView;
     FilePath   = filePath;
     Service    = service ?? FileWatcherService.Instance;
     Enabled    = enabled;
 }