public Task Log(FSWModel fswModel)
        {
            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                                       new Action(() =>
            {
                _observableCollection.Add(fswModel);
            }));

            return(new Task(() => { }));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }