/[RomCheater]/trunk/RomCheater/Main.cs
ViewVC logotype

Diff of /trunk/RomCheater/Main.cs

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

revision 812 by william, Thu Jun 20 20:04:53 2013 UTC revision 813 by william, Tue Apr 15 14:58:01 2014 UTC
# Line 34  using Sojaner.MemoryScanner; Line 34  using Sojaner.MemoryScanner;
34  using RomCheater.PluginFramework.Events;  using RomCheater.PluginFramework.Events;
35  using RomCheater.Serialization;  using RomCheater.Serialization;
36  using RomCheater.Core;  using RomCheater.Core;
37    using Enterprise.Logging;
38    
39  namespace RomCheater  namespace RomCheater
40  {  {
# Line 70  namespace RomCheater Line 71  namespace RomCheater
71          //static Main() { SettingSubscriber.AddSubscriber(new Main(), Settings.Default); }          //static Main() { SettingSubscriber.AddSubscriber(new Main(), Settings.Default); }
72          //private const string t = "RomCheater";          //private const string t = "RomCheater";
73          #region LogWriterSupport          #region LogWriterSupport
74          static LogWriter _LoggerInstance;          //static LogWriter _LoggerInstance;
75          static LogWriter LoggerInstance          //static LogWriter LoggerInstance
76          {          //{
77              get { return _LoggerInstance; }          //    get { return _LoggerInstance; }
78              set { _LoggerInstance = value; }          //    set { _LoggerInstance = value; }
79          }          //}
80          #endregion          #endregion
81    
82    
# Line 342  namespace RomCheater Line 343  namespace RomCheater
343          public void ShowLogWindow()          public void ShowLogWindow()
344          {          {
345              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }
346              LoggerInstance = m_LogWindow.Logwriter;              //LoggerInstance = m_LogWindow.Logwriter;
347              LoggerInstance.CreateNewLog(false);              //LoggerInstance.CreateNewLog(false);
348              m_LogWindow.Show(dockPanel, DockState.DockBottom);                    m_LogWindow.Show(dockPanel, DockState.DockBottom);      
349          }          }
350          public void ShowAboutBox()          public void ShowAboutBox()
# Line 443  namespace RomCheater Line 444  namespace RomCheater
444              SettingsSubscriber.AddSubscriber(this, Settings.Default);              SettingsSubscriber.AddSubscriber(this, Settings.Default);
445              load_loggerflags();              load_loggerflags();
446              SetupDocks();              SetupDocks();
447              LoggerInstance = m_LogWindow.Logwriter;              //LoggerInstance = m_LogWindow.Logwriter;
448              LoggerInstance.CreateNewLog(false);              //LoggerInstance.CreateNewLog(false);
449              logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);              //logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);
450              load_plugins();              load_plugins();
451              if (no_console_redirect)              //if (no_console_redirect)
452                  LoggerInstance.RedirectConsoleOutput = false;                        //    LoggerInstance.RedirectConsoleOutput = false;          
453          }          }
454          private void load_loggerflags()          private void load_loggerflags()
455          {          {
456              logger.SetLoggingFlags(Logging.Properties.Settings.Default.LoggingFlags);              //logger.SetLoggingFlags(Logging.Properties.Settings.Default.LoggingFlags);
457  #if FORCE_ALL_LOGGING_FLAGS  #if FORCE_ALL_LOGGING_FLAGS
458              logger.SetLoggingFlags(loggerflags.ALL);              //logger.SetLoggingFlags(loggerflags.ALL);
459  #endif  #endif
460          }          }
461          private void load_plugins() { load_plugins(false); }          private void load_plugins() { load_plugins(false); }
# Line 466  namespace RomCheater Line 467  namespace RomCheater
467    
468              ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);              ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);
469              if (ConfigPlugin != null && !silent)              if (ConfigPlugin != null && !silent)
470                  logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());                  gLog.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
471              InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);              InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);
472              if (InputPlugin != null && !silent)              if (InputPlugin != null && !silent)
473                  logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());                  gLog.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());
474              WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);              WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);
475              if (WindowPlugin != null && !silent)              if (WindowPlugin != null && !silent)
476                  logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());                  gLog.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());
477    
478    
479              UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);              UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);
# Line 481  namespace RomCheater Line 482  namespace RomCheater
482                  foreach (var t in UserControlPlugins)                  foreach (var t in UserControlPlugins)
483                  {                  {
484                      if (!silent)                      if (!silent)
485                          logger.Info.WriteLine("Loaded UserControl Plugin: {0}", t.ToString());                          gLog.Info.WriteLine("Loaded UserControl Plugin: {0}", t.ToString());
486                  }                  }
487    
488                  string stacktrace = System.Environment.StackTrace;                  string stacktrace = System.Environment.StackTrace;
# Line 525  namespace RomCheater Line 526  namespace RomCheater
526          {          {
527              RomCheaterConfigDialog dlg = new RomCheaterConfigDialog(loader);              RomCheaterConfigDialog dlg = new RomCheaterConfigDialog(loader);
528              dlg.ShowDialog();              dlg.ShowDialog();
529              logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);              //logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);
530              // reload plugins              // reload plugins
531              load_plugins(true);              load_plugins(true);
532          }          }

Legend:
Removed from v.812  
changed lines
  Added in v.813

  ViewVC Help
Powered by ViewVC 1.1.22