示例#1
0
        private void OnChanged(object sender, FileSystemEventArgs e)
        {
            if (e.ChangeType.HasFlag(WatcherChangeTypes.Created))
            {
                ContentChanged.SafeInvoke(this, new FolderNodeEventArgs(WatcherChangeTypes.Created, null, e.FullPath));
            }

            if (e.ChangeType.HasFlag(WatcherChangeTypes.Deleted))
            {
                ContentChanged.SafeInvoke(this, new FolderNodeEventArgs(WatcherChangeTypes.Deleted, e.FullPath, null));
            }

            if (e.ChangeType.HasFlag(WatcherChangeTypes.Changed))
            {
                ContentChanged.SafeInvoke(this, new FolderNodeEventArgs(WatcherChangeTypes.Changed, e.FullPath, e.FullPath));
            }
        }
示例#2
0
 private void OnRenamed(object sender, RenamedEventArgs e)
 {
     ContentChanged.SafeInvoke(this, new FolderNodeEventArgs(WatcherChangeTypes.Renamed, e.OldFullPath, e.FullPath));
 }