protected override WatcherData GetWatcherData(string pathname, ISyncEventQueue queue) { WatcherData watcherData = new WatcherData(); watcherData.Data = new EventQueue(queue); watcherData.Watcher = new MacWatcher(pathname, watcherData.Data as ISyncEventQueue, TimeSpan.FromMilliseconds(100)); return(watcherData); }
protected override WatcherData GetWatcherData(string pathname, ISyncEventQueue queue) { WatcherData watcherData = new WatcherData(); watcherData.Data = new Tuple <FileSystemWatcher, IMetaDataStorage>(new FileSystemWatcher(pathname), this.storage.Object); watcherData.Watcher = new NetWatcher((watcherData.Data as Tuple <FileSystemWatcher, IMetaDataStorage>).Item1, queue, this.storage.Object); return(watcherData); }
protected override void WaitWatcherData(WatcherData watcherData, string pathname, WatcherChangeTypes types, int milliseconds) { EventQueue queue = watcherData.Data as EventQueue; while (milliseconds >= 0) { FSEvent[] events; lock (queue.Events) { events = queue.Events.ToArray(); } foreach (FSEvent fsEvent in events) { if (fsEvent.LocalPath == pathname && fsEvent.Type == types) { return; } } Thread.Sleep(10); milliseconds -= 10; } }
protected virtual void WaitWatcherData(WatcherData watcherData, string pathname, WatcherChangeTypes types, int milliseconds) { Assert.Fail("to be implemented in sub class"); }
protected override void WaitWatcherData(WatcherData watcherData, string pathname, WatcherChangeTypes types, int milliseconds) { FileSystemWatcher watcher = (watcherData.Data as Tuple <FileSystemWatcher, IMetaDataStorage>).Item1; watcher.WaitForChanged(types, milliseconds); }
protected override void WaitWatcherData(WatcherData watcherData, string pathname, WatcherChangeTypes types, int milliseconds) { FileSystemWatcher watcher = (watcherData.Data as Tuple<FileSystemWatcher, IMetaDataStorage>).Item1; watcher.WaitForChanged(types, milliseconds); }
protected override WatcherData GetWatcherData(string pathname, ISyncEventQueue queue) { WatcherData watcherData = new WatcherData(); watcherData.Data = new Tuple<FileSystemWatcher, IMetaDataStorage>(new FileSystemWatcher(pathname), this.storage.Object); watcherData.Watcher = new NetWatcher((watcherData.Data as Tuple<FileSystemWatcher, IMetaDataStorage>).Item1, queue, this.storage.Object); return watcherData; }
protected override WatcherData GetWatcherData(string pathname, ISyncEventQueue queue) { WatcherData watcherData = new WatcherData(); watcherData.Data = new EventQueue(queue); watcherData.Watcher = new MacWatcher(pathname, watcherData.Data as ISyncEventQueue, TimeSpan.FromMilliseconds(100)); return watcherData; }