some UI staff

This commit is contained in:
qianlifeng
2013-12-22 00:44:56 +08:00
parent 2d339ba00a
commit dcf52085ae
26 changed files with 846 additions and 68 deletions

View File

@@ -20,15 +20,19 @@ namespace WinAlfred.PluginLoader
try
{
Assembly asm = Assembly.LoadFile(metadata.ExecuteFile);
List<Type> types = asm.GetTypes().Where(o => o.GetInterfaces().Contains(typeof(IPlugin))).ToList();
List<Type> types = asm.GetTypes().Where(o => o.GetInterfaces().Contains(typeof (IPlugin))).ToList();
if (types.Count == 0)
{
Log.Error(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin", metadata.Name));
Log.Error(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin",
metadata.Name));
continue;
}
if (types.Count > 1)
{
Log.Error(string.Format("Cound't load plugin {0}: find more than one class who implement IPlugin, there should only one class implement IPlugin", metadata.Name));
Log.Error(
string.Format(
"Cound't load plugin {0}: find more than one class who implement IPlugin, there should only one class implement IPlugin",
metadata.Name));
continue;
}
@@ -43,9 +47,9 @@ namespace WinAlfred.PluginLoader
{
Log.Error(string.Format("Cound't load plugin {0}: {1}", metadata.Name, e.Message));
#if (DEBUG)
{
throw;
}
{
throw;
}
#endif
}