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

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

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

--- trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs	2012/06/07 18:32:25	328
+++ trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs	2012/06/07 19:18:31	329
@@ -19,30 +19,32 @@
     public abstract class ConfigPlugin : PluginBase, IConfigPlugin
     {
         public ConfigPlugin() : this(false) { }
-        public ConfigPlugin(bool doinit) : base() { this.ValidProcessesForPlugin = new List<ProcContainer>(); if(doinit) init(); }
+        public ConfigPlugin(bool doinit) : base() { this.ValidProcessesForPlugin = new List<ProcContainer>(); if (doinit) init(); }
 
-        public override void Reload()
+        public override void Reload(bool silent)
         {
-            logger.Debug.WriteLine(" Loading config for {0}...", this.ToString());
+            if (!silent)
+                logger.Debug.WriteLine(" Loading config for {0}...", this.ToString());
             init();
-            logger.Debug.WriteLine(" Loaded config for {0}.", this.ToString());
+            if (!silent)
+                logger.Debug.WriteLine(" Loaded config for {0}.", this.ToString());
         }
         private void init()
         {
-//            loggerflags flags = logger.GetLoggingFlags();
+            //            loggerflags flags = logger.GetLoggingFlags();
 
-//#if DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST
-//            ushort performance_flags = flags.Value;
-//            if (flags.HasFlag(loggerflags.VERBOSE_DEBUG))
-//            {
-//                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_DEBUG.Value);
-//            }
-//            if (flags.HasFlag(loggerflags.VERBOSE_ERROR))
-//            {
-//                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_ERROR.Value);
-//            }
-//#endif
-//            logger.SetLoggingFlags(performance_flags);
+            //#if DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST
+            //            ushort performance_flags = flags.Value;
+            //            if (flags.HasFlag(loggerflags.VERBOSE_DEBUG))
+            //            {
+            //                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_DEBUG.Value);
+            //            }
+            //            if (flags.HasFlag(loggerflags.VERBOSE_ERROR))
+            //            {
+            //                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_ERROR.Value);
+            //            }
+            //#endif
+            //            logger.SetLoggingFlags(performance_flags);
 
             List<ProcContainer> proc_list = new List<ProcContainer>();
             foreach (Process proc in Process.GetProcesses())
@@ -65,38 +67,42 @@
                     try
                     {
                         container = new ProcContainer(proc);
-                        #if !DISALLOW_VERBOSE_LOGGING
+#if !DISALLOW_VERBOSE_LOGGING
                         logger.VerboseDebug.WriteLine("  adding process {0} ", proc_name);
 #endif
                         proc_list.Add(container);
                     }
                     catch (FileNotFoundException) { }
+#if !DISALLOW_VERBOSE_LOGGING
                     catch (Exception ex)
                     {
                         //throw;
-                        #if !DISALLOW_VERBOSE_LOGGING
                         logger.VerboseError.WriteLine("    not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString());
-#endif
                         //continue;
                     }
+#else
+                    catch (Exception) { }
+#endif
                 }
                 catch (System.ComponentModel.Win32Exception ex)
                 {
                     if (!((uint)ex.ErrorCode == 0x80004005))
                     {
-                        #if !DISALLOW_VERBOSE_LOGGING
+#if !DISALLOW_VERBOSE_LOGGING
                         logger.VerboseError.WriteLine("    not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString());
 #endif
-                    }                   
+                    }
                     //continue;
                 }
+#if !DISALLOW_VERBOSE_LOGGING
                 catch (Exception ex)
                 {
-                    #if !DISALLOW_VERBOSE_LOGGING
                     logger.VerboseError.WriteLine("    not adding process {0} because it thew an exception [{1}]", proc_name, ex.ToString());
-#endif
                     //continue;
                 }
+#else
+                catch (Exception) { }
+#endif
             }
             proc_list = proc_list.OrderBy(p => p.Name).ToList();
             Predicate<ProcContainer> predicate = new Predicate<ProcContainer>(IsNotValidProcess);

 

  ViewVC Help
Powered by ViewVC 1.1.22