Hello,
I am watching a directory so i am using system watcher and on the event handler, I would like when the event happens, to execute a function that does a specific job. How can i call a function inside the event handler or a way to say that when the event happens, go and do what is written in the following function. Thanks in Advance
- static void OnChanged(object source, FileSystemEventArgs e)
- {
-
-
- Console.WriteLine("File: " + e.FullPath + " " + e.ChangeType);
- SomeGlobalVariables.counter++;
- SomeGlobalVariables.Range = SomeGlobalVariables.counter + 1;
- Console.WriteLine("Counter is" + SomeGlobalVariables.counter + "," + "Range is" + SomeGlobalVariables.Range);
-
-
-
-
- }
-
- static void ReadDATA(out string[,] Result)
- {
-
-
- }