private void Process(string key, string fileName)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(fileName))
         {
             IO.Log(string.Format("Processing: {0}. {1}", key, fileName));
             ProcessorHelper.Process(key, fileName);
         }
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
Beispiel #2
0
        private void fsw_eventHandler(object sender, System.IO.FileSystemEventArgs e)
        {
            var sleepTimeout = 100;

            switch (e.ChangeType)
            {
            case WatcherChangeTypes.Created:
                while (IO.IsFileLocked(e.FullPath) == true)
                {
                    IO.Log("Locked...Sleeping...");
                    System.Threading.Thread.Sleep(sleepTimeout);
                }

                IO.Log(string.Format("Created: {0}", e.FullPath));
                ProcessorHelper.Process(e.FullPath);
                break;

            default:     // Another action
                break;
            }
        }