Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }