protected override void OnStart(string[] args) { changeMethodDelegate changeWatchmethod = new changeMethodDelegate(InvokeMethod); renameMethodDelegate renameWatchmethod = new renameMethodDelegate(InvokeMethod); w1 = new Watcher(System.Configuration.ConfigurationSettings.AppSettings["WatchForder"]//Settings1.Default.WatchForder , System.Configuration.ConfigurationSettings.AppSettings["FileFilter"]//Settings1.Default.FileFilter , changeWatchmethod , renameWatchmethod); w1.StartWatch(); tr.Start(); }
private void button1_Click(object sender, EventArgs e) { changeMethodDelegate changeWatchmethod = new changeMethodDelegate(InvokeMethod); renameMethodDelegate renameWatchmethod = new renameMethodDelegate(InvokeMethod); w1 = new Watcher(System.Configuration.ConfigurationSettings.AppSettings["WatchForder"]//Settings1.Default.WatchForder , System.Configuration.ConfigurationSettings.AppSettings["FileFilter"]//Settings1.Default.FileFilter , changeWatchmethod , renameWatchmethod); w1.StartWatch(); WatcherTimerDelegate writelog = new WatcherTimerDelegate(log); tr.setOutMsg = writelog; tr.Start(); }