Esempio n. 1
0
        public static void DisposeImageWatcher(ref ImageWatcher watcher, ImageWatcher.EndOfFileEventHandler endOfFileEventHandler)
        {
            if (watcher == null)
            {
                return;
            }

            if (endOfFileEventHandler != null)
            {
                watcher.EndOfFileEventDetected -= endOfFileEventHandler;
            }
            watcher.Dispose();
        }
Esempio n. 2
0
 public static void CreateImageWatcher(out ImageWatcher watcher, ICollection <string> imageExtensions, ICollection <string> monitoringPaths, int newPageTimeout, ImageWatcher.EndOfFileEventHandler endOfFileEventHandler)
 {
     watcher = new ImageWatcher(monitoringPaths, newPageTimeout)
     {
         ImageExtensions = imageExtensions
     };
     watcher.EndOfFileEventDetected += endOfFileEventHandler;
 }