private void Watcher_Process(object sender, FileSystemEventArgs e) { lock (lockObject) { Watcher_Turn(false); Thread thread_Watcher_Process = new Thread(() => { lock (threads) { foreach (var thr in threads) { if (thr != null) { thr.Abort(); } } threads = new List <Thread>(); Thread.CurrentThread.Name = "Watcher_" + this.MethodName; threads.Add(Thread.CurrentThread); } Thread.Sleep(time); Thread threadCallProcess = new Thread(() => { DelegateToMethod.GetTypeOfDelegate(MethodName, ClassName).Item1.DynamicInvoke(Config.ToArray()); }); threadCallProcess.Start(); threadCallProcess.Join(); threads.Remove(Thread.CurrentThread); Times++; }); thread_Watcher_Process.Start(); thread_Watcher_Process.Join(); Watcher_Turn(true); } }