public Task Log(FSWModel fswModel) { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { _observableCollection.Add(fswModel); })); return(new Task(() => { })); }
private async void FileSystemWatcher_Changed(object sender, FileSystemEventArgs e) { var eventInfo = $"Attributes changed for {e.Name} at path {e.FullPath}"; var model = new FSWModel { Event = e.ChangeType, Path = e.FullPath, EventInfo = eventInfo }; await _watcherLoggingService.Log(model); }
private async void FileSystemWatcher_Renamed(object sender, RenamedEventArgs e) { var eventInfo = $"Renamed from {e.OldName} to {e.Name}\nOld path: {e.OldFullPath}\nNew path: {e.FullPath}"; var model = new FSWModel { Event = e.ChangeType, Path = e.FullPath, EventInfo = eventInfo }; await _watcherLoggingService.Log(model); }