Beispiel #1
0
 public AddInWatcher(AddInReloaderConfiguration config)
 {
     foreach (var addIn in config.WatchedAddIns)
     {
         foreach (var file in addIn.WatchedFiles)
         {
             var directory = Path.GetDirectoryName(file.Path);
             WatchedDirectory wd;
             if (!_watchedDirectories.TryGetValue(directory, out wd))
             {
                 wd = new WatchedDirectory(directory, InvalidateAddIn);
             }
             wd.WatchAddIn(addIn);
         }
     }
 }
Beispiel #2
0
 public AddInWatcher(AddInReloaderConfiguration config)
 {
     foreach (var addIn in config.WatchedAddIns)
     {
         foreach (var file in addIn.WatchedFiles)
         {
             var directory = Path.GetDirectoryName(file.Path);
             WatchedDirectory wd;
             if (!_watchedDirectories.TryGetValue(directory, out wd))
             {
                 wd = new WatchedDirectory(directory, InvalidateAddIn);
             }
             wd.WatchAddIn(addIn);
         }
     }
 }
Beispiel #3
0
        public void AutoOpen()
        {
            var configFileName = "AddInReloaderConfiguration.xml";
            var xllDirectory   = Path.GetDirectoryName(ExcelDnaUtil.XllPath);
            var configPath     = Path.Combine(xllDirectory, configFileName);

            try
            {
                // Load config
                XmlSerializer configLoader        = new XmlSerializer(typeof(AddInReloaderConfiguration));
                AddInReloaderConfiguration config = (AddInReloaderConfiguration)configLoader.Deserialize(File.OpenRead(configPath));
                _watcher = new AddInWatcher(config);
            }
            catch (Exception ex)
            {
                LogDisplay.WriteLine("AddInReloader - Error loading the configuration file: " + ex.ToString());
            }
        }