/[RomCheater]/trunk/RomCheater.PluginFramework/Core/PluginLoader.cs
ViewVC logotype

Diff of /trunk/RomCheater.PluginFramework/Core/PluginLoader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.PluginFramework/Core/PluginLoader.cs	2012/05/09 18:13:51	85
+++ trunk/RomCheater.PluginFramework/Core/PluginLoader.cs	2012/05/09 19:51:42	87
@@ -44,6 +44,18 @@
 
                 logger.Info.WriteLine("Plugins Loaded.");
             }
+            catch (ReflectionTypeLoadException ex)
+            {
+                StringBuilder builder = new StringBuilder();
+                if (ex.LoaderExceptions.Count() > 0)
+                {
+                    foreach (Exception c in ex.LoaderExceptions)
+                    {
+                        builder.AppendLine(c.ToString());
+                    }
+                }
+                logger.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, builder.ToString());
+            }
             catch (Exception ex)
             {
                 logger.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, ex.ToString());
@@ -52,6 +64,23 @@
         public List<IConfigPlugin> LoadedConfigPlugins { get; private set; }
         public List<IInputPlugin> LoadedInputPlugins { get; private set; }
         public List<IWindowPlugin> LoadedWindowPlugins { get; private set; }
+
+        public IConfigPlugin GetConfigPlugin(string t)
+        {
+            foreach (IConfigPlugin c in LoadedConfigPlugins) { if (c.ToString().ToLower() == t.ToLower()) { return c; } }
+            return null;
+        }
+        public IInputPlugin GetInputPlugin(string t)
+        {
+            foreach (IInputPlugin c in LoadedInputPlugins) { if (c.ToString().ToLower() == t.ToLower()) { return c; } }
+            return null;
+        }
+        public IWindowPlugin GetWindowPlugin(string t)
+        {
+            foreach (IWindowPlugin c in LoadedWindowPlugins) { if (c.ToString().ToLower() == t.ToLower()) { return c; } }
+            return null;
+        }
+
         #endregion
 
         private void GetConfigPluginsFromDll(FileInfo dll)

 

  ViewVC Help
Powered by ViewVC 1.1.22