public void WatchAddIn(WatchedAddIn addIn) { foreach (var file in addIn.WatchedFiles) { var fullPath = System.IO.Path.GetFullPath(file.Path); _watchedFiles[fullPath] = addIn; // This only allows one add-in to watch a particular file. } }
// Called in the event handler - don't do slow work here. void InvalidateAddIn(WatchedAddIn watchedAddIn) { lock (_dirtyLock) { _dirtyAddIns.Add(watchedAddIn); ExcelAsyncUtil.QueueAsMacro(ReloadDirtyAddIns); } }