public void TestCase() { var fileWatch = new ChangeWatcher(); var settings = new WatchSettings { Pattern = "*.cs", Path = "../../", Recursive = false }; fileWatch.Watch(settings, (changed) => { changed.ToList().ForEach(x => Console.WriteLine(x.FullPath)); }); }
public static void Main(string[] args) { var fileWatch = new ChangeWatcher(); var settings = new WatchSettings { Pattern = "*.cs", Path = "/Users/wk/Source/github/cake-addin/Cake.Watch", Recursive = true }; fileWatch.Watch(settings, (changed) => { foreach (var change in changed) { System.Console.WriteLine(change.Status); System.Console.WriteLine(change.Name); System.Console.WriteLine(change.FullPath); } }); while (System.Console.ReadLine() != "q") { } }