Exemplo n.º 1
0
 private void WriteToLog(object sender, MyWatcherChangeType type, MyFile file)
 {
     this.Invoke((MethodInvoker) delegate
     {
         string path = file.FullPath;
         textBoxLog.AppendText(path + " has " + type.ToString());
         textBoxLog.AppendText(Environment.NewLine);
     });
 }
Exemplo n.º 2
0
        private void Handler(object sender, MyWatcherChangeType type, MyFile file)
        {
            switch (type)
            {
            case MyWatcherChangeType.Create:
            {
                OnCreate(file);
                break;
            }

            case MyWatcherChangeType.Delete:
            {
                OnDelete(file);
                break;
            }

            case MyWatcherChangeType.Modify:
            {
                OnModify(file);
                break;
            }
            }
            handlers(sender, type, file);
        }