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);
}
}
{
Assembly assPlugin = Assembly.LoadFile(sFile);
+ Console.WriteLine("Loading plugins from : {0}", assPlugin.Location);
+
if (assPlugin != null)
{
foreach (Type pluginType in assPlugin.GetTypes())
{
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));
}