X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=irc%2FTechBot%2FTechBot.Library%2FFactory%2FCommandFactory.cs;h=100bd2bdcf4392df0a47aa0a78999cef925f5e46;hp=34e3471f6f811b8e6f4d4141516208889121cc27;hb=ac77d9d3a6afb7faac0b2ea73a5483a06ef44794;hpb=d7b2077ed83649c059bddfdf705d758b728c0499 diff --git a/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs b/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs index 34e3471f6f8..100bd2bdcf4 100644 --- a/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs +++ b/irc/TechBot/TechBot.Library/Factory/CommandFactory.cs @@ -18,11 +18,9 @@ namespace TechBot.Library public static void LoadPlugins() { //get the file names of the dll files in the current directory. - FileInfo objExeInfo = new FileInfo(@"C:\Ros\current\irc\TechBot\TechBot.Console\bin\Debug\"); - - foreach (FileInfo objInfo in objExeInfo.Directory.GetFiles("*.dll")) + foreach (string fileName in Directory.GetFiles(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "*.dll")) { - LoadPluginsFromDLLFile(objInfo.FullName); + LoadPluginsFromDLLFile(fileName); } } @@ -30,6 +28,8 @@ namespace TechBot.Library { Assembly assPlugin = Assembly.LoadFile(sFile); + Console.WriteLine("Loading plugins from : {0}", assPlugin.Location); + if (assPlugin != null) { foreach (Type pluginType in assPlugin.GetTypes()) @@ -38,6 +38,12 @@ namespace TechBot.Library { if (pluginType.IsAbstract == false) { + CommandBuilder cmdBuilder = new CommandBuilder(pluginType); + + Console.WriteLine("{0}:{1}", + cmdBuilder.Name, + cmdBuilder.Description); + //Add it to the list. Commands.Add(new CommandBuilder(pluginType)); }