Exemple #1
0
 public void RecursiveFiles()
 {
     _finder = new Finder("..\\..\\..\\Modules\\Debug", true);
     List<String> lt = new List<String>(Directory.GetFiles("E:\\Projects\\VS\\Warframe Activity Manager\\Modules\\Debug", "WAM.Modules.*.dll", SearchOption.AllDirectories));
     List<FileInfo> lf = _finder.FindFiles("WAM.Modules.*.dll");
     Assert.AreEqual(lt.Count, lf.Count, "File List comparison failed : \r\n Tested : {0} \r\n Finder : {1}\r\n", lt.Count, lf.Count);
 }
Exemple #2
0
        private List <IPlugin> LoadModulesFromList(String pattern)
        {
            //Get all plugins with given name regexp
            log.Info("Initializing Finder");
            List <FileInfo> files = _finder.FindFiles(pattern);

            log.Info("Got " + files.Count + " files");
            //Iterate over results and load each file into separate container
            //Then store the container into a plugin list
            log.Info("Trying to load each file :");
            foreach (FileInfo file in files)
            {
                log.Info("Attempting to load file " + file.FullName);
                IPluginContainer pc = new PluginContainer();
                pc.LoadPlugin(file.FullName);
                if (pc.Modules.Count > 0)
                {
                    log.Info("Loading the plugin in the file " + file.FullName + " has succeeded");
                    pc.Modules.ForEach(p => _plugins[p] = pc);
                    _pluginContainers.Add(pc);
                }
                else
                {
                    log.Info("Failed to load the plugin in the file " + file.FullName);
                }
            }

            log.Info("Successfully loaded " + _plugins.Count + " files");

            //Return a list of all modules loaded
            return(_plugins.Keys.ToList());
        }
Exemple #3
0
        public void RecursiveFiles()
        {
            _finder = new Finder("..\\..\\..\\Modules\\Debug", true);
            List <String>   lt = new List <String>(Directory.GetFiles("E:\\Projects\\VS\\Warframe Activity Manager\\Modules\\Debug", "WAM.Modules.*.dll", SearchOption.AllDirectories));
            List <FileInfo> lf = _finder.FindFiles("WAM.Modules.*.dll");

            Assert.AreEqual(lt.Count, lf.Count, "File List comparison failed : \r\n Tested : {0} \r\n Finder : {1}\r\n", lt.Count, lf.Count);
        }