Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 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;
            }
        }