public void ScanPackage() { LoadGingerPluginsDLL(); //TODO: scan all DLLs in the folder, only ones which ends with *GingerPlugin.dll - so we don't load or scan unneeded DLLs 0- faster // add . string[] files = Directory.GetFiles(Folder, "*.GingerPlugin.dll", SearchOption.AllDirectories); if (files.Length > 0) { foreach (string filename in files) { // Just get assmebly info - not loading it! AssemblyName ans = AssemblyName.GetAssemblyName(filename); PluginAssemblyInfo PAI = new PluginAssemblyInfo(); PAI.Name = ans.Name; PAI.FilePath = filename; mAssembliesInfo.Add(PAI); } Isloaded = true; } else { throw new Exception("Plugin folder doesn't contain any *.GingerPlugin.dll - Folder" + Folder); } }
public void LoadInfoFromDLL() { LoadGingerPluginsDLL(); string startupDLLFileName = Path.Combine(mFolder, mPluginPackageInfo.StartupDLL); PluginAssemblyInfo PAI = new PluginAssemblyInfo(); PAI.Name = startupDLLFileName; PAI.FilePath = startupDLLFileName; mAssembliesInfo.Add(PAI); LoadPluginServicesFromDll(); }
public void ScanPackage() { LoadGingerPluginsDLL(); string startupDLLFileName = Path.Combine(mFolder, mPluginPackageInfo.StartupDLL); AssemblyName assmenblyName = AssemblyName.GetAssemblyName(startupDLLFileName); PluginAssemblyInfo PAI = new PluginAssemblyInfo(); PAI.Name = startupDLLFileName; PAI.FilePath = startupDLLFileName; mAssembliesInfo.Add(PAI); // Scan all DLLs in the folder, only ones which ends with *.GingerPlugin.dll - so we don't load or scan unneeded DLLs - faster //string[] files = Directory.GetFiles(Folder, "*.GingerPlugin.dll", SearchOption.AllDirectories); //if (files.Length > 0) //{ // foreach (string fileName in files) // { // // Just get assmebly info - not loading it! // AssemblyName assmenblyName = AssemblyName.GetAssemblyName(fileName); // PluginAssemblyInfo PAI = new PluginAssemblyInfo(); // PAI.Name = assmenblyName.Name; // PAI.FilePath = fileName; // mAssembliesInfo.Add(PAI); // } // Isloaded = true; //} //else //{ // throw new Exception("Plugin folder doesn't contain any *.GingerPlugin.dll - Folder" + Folder); //} }