/[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	2014/04/15 14:30:48	811
+++ trunk/RomCheater.PluginFramework/Core/PluginLoader.cs	2014/04/15 14:52:10	812
@@ -21,6 +21,7 @@
 using RomCheater.Core;
 using System.Runtime.Serialization;
 using System.Security;
+using Enterprise.Logging;
 
 namespace RomCheater.PluginFramework.Core
 {
@@ -408,22 +409,22 @@
             try
             {
                 if (!silent)
-                    logger.Info.WriteLine("Loading Plugins...");
+                    gLog.Info.WriteLine("Loading Plugins...");
 
                 string PluginPath = string.Format(@"{0}\Plugins", typeof(PluginLoader).Assembly.Location.Replace(@"\RomCheater.PluginFramework.dll", ""));
                 if (!silent)
-                    logger.Debug.WriteLine("Plugins Path: {0}", PluginPath);
+                    gLog.Debug.WriteLine("Plugins Path: {0}", PluginPath);
                 List<string> dlls = new List<string>(Directory.GetFiles(PluginPath, "*.dll"));
                 // also load any default plugins from the framework
                 dlls.Add(typeof(PluginLoader).Assembly.Location);
 
                 if (!silent)
-                    logger.Debug.WriteLine("  Found: {0} plugin dlls", dlls.Count);
+                    gLog.Debug.WriteLine("  Found: {0} plugin dlls", dlls.Count);
                 foreach (string dll in dlls)
                 {
                     FileInfo fi = new FileInfo(dll);
                     if (!silent)
-                        logger.Debug.WriteLine("    plugin[{0}]: {1}", dlls.IndexOf(dll), fi.Name);
+                        gLog.Debug.WriteLine("    plugin[{0}]: {1}", dlls.IndexOf(dll), fi.Name);
                     GetConfigPluginsFromDll(fi);
                     GetInputPluginsFromDll(fi);
                     GetWindowPluginsFromDll(fi);
@@ -433,15 +434,15 @@
                 
 
                 if (!silent)
-                    logger.Info.WriteLine("  Loaded {0} config plugins", LoadedConfigPlugins.Count);
+                    gLog.Info.WriteLine("  Loaded {0} config plugins", LoadedConfigPlugins.Count);
                 if (!silent)
-                    logger.Info.WriteLine("  Loaded {0} input plugins", LoadedInputPlugins.Count);
+                    gLog.Info.WriteLine("  Loaded {0} input plugins", LoadedInputPlugins.Count);
                 if (!silent)
-                    logger.Info.WriteLine("  Loaded {0} window plugins", LoadedWindowPlugins.Count);
+                    gLog.Info.WriteLine("  Loaded {0} window plugins", LoadedWindowPlugins.Count);
                 if (!silent)
-                    logger.Info.WriteLine("  Loaded {0} usercontrol plugins", LoadedUserControlPlugins.Count);
+                    gLog.Info.WriteLine("  Loaded {0} usercontrol plugins", LoadedUserControlPlugins.Count);
                 if (!silent)
-                    logger.Info.WriteLine("Plugins Loaded.");
+                    gLog.Info.WriteLine("Plugins Loaded.");
             }
             catch (ReflectionTypeLoadException ex)
             {
@@ -454,12 +455,12 @@
                     }
                 }
                 if (!silent)
-                    logger.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, builder.ToString());
+                    gLog.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, builder.ToString());
             }
             catch (Exception ex)
             {
                 if (!silent)
-                    logger.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, ex.ToString());
+                    gLog.Error.WriteLine("Failed to load one or more plugins{0}Possible Reason:{0}{1}", System.Environment.NewLine, ex.ToString());
             }
         }
         public List<IConfigPlugin> LoadedConfigPlugins { get; private set; }
@@ -506,7 +507,7 @@
 
         private void GetConfigPluginsFromDll(FileInfo dll)
         {
-            logger.Debug.WriteLine("  Getting Config plugins contained in {0}", dll.Name);
+            gLog.Debug.WriteLine("  Getting Config plugins contained in {0}", dll.Name);
             Assembly asm = Assembly.LoadFile(dll.FullName);
             List<Type> types = new List<Type>(asm.GetTypes());
             foreach (Type type in types)
@@ -529,7 +530,7 @@
                         }
                         else
                         {
-                            logger.Debug.WriteLine("    Loaded Config Plugin [name={0}] from {1}", c.Name, dll.Name);
+                            gLog.Debug.WriteLine("    Loaded Config Plugin [name={0}] from {1}", c.Name, dll.Name);
                             LoadedConfigPlugins.Add(c);
                         }
                     }
@@ -538,7 +539,7 @@
         }
         private void GetInputPluginsFromDll(FileInfo dll)
         {
-            logger.Debug.WriteLine("  Getting Input plugins contained in {0}", dll.Name);
+            gLog.Debug.WriteLine("  Getting Input plugins contained in {0}", dll.Name);
             Assembly asm = Assembly.LoadFile(dll.FullName);
             List<Type> types = new List<Type>(asm.GetTypes());
             foreach (Type type in types)
@@ -561,7 +562,7 @@
                         }
                         else
                         {
-                            logger.Debug.WriteLine("    Loaded Input Plugin [name={0}] from {1}", c.Name, dll.Name);
+                            gLog.Debug.WriteLine("    Loaded Input Plugin [name={0}] from {1}", c.Name, dll.Name);
                             LoadedInputPlugins.Add(c);
                         }
                     }
@@ -570,7 +571,7 @@
         }
         private void GetWindowPluginsFromDll(FileInfo dll)
         {
-            logger.Debug.WriteLine("  Getting Window plugins contained in {0}", dll.Name);
+            gLog.Debug.WriteLine("  Getting Window plugins contained in {0}", dll.Name);
             Assembly asm = Assembly.LoadFile(dll.FullName);
             List<Type> types = new List<Type>(asm.GetTypes());
             foreach (Type type in types)
@@ -593,7 +594,7 @@
                         }
                         else
                         {
-                            logger.Debug.WriteLine("    Loaded Window Plugin [name={0}] from {1}", c.Name, dll.Name);
+                            gLog.Debug.WriteLine("    Loaded Window Plugin [name={0}] from {1}", c.Name, dll.Name);
                             LoadedWindowPlugins.Add(c);
                         }
                     }
@@ -602,7 +603,7 @@
         }
         private void GetUserControlPluginsFromDll(FileInfo dll)
         {
-            logger.Debug.WriteLine("  Getting UserControl plugins contained in {0}", dll.Name);
+            gLog.Debug.WriteLine("  Getting UserControl plugins contained in {0}", dll.Name);
             Assembly asm = Assembly.LoadFile(dll.FullName);
             List<Type> types = new List<Type>(asm.GetTypes());
             foreach (Type type in types)
@@ -625,7 +626,7 @@
                         }
                         else
                         {
-                            logger.Debug.WriteLine("    Loaded UserControl Plugin [name={0}] from {1}", c.Name, dll.Name);
+                            gLog.Debug.WriteLine("    Loaded UserControl Plugin [name={0}] from {1}", c.Name, dll.Name);
                             LoadedUserControlPlugins.Add(c);
                         }
                     }

 

  ViewVC Help
Powered by ViewVC 1.1.22