/[RomCheater]/trunk/RomCheater.RVAScratchPad/Form1.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVAScratchPad/Form1.cs

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

revision 813 by william, Tue Apr 15 14:58:01 2014 UTC revision 853 by william, Tue Sep 16 20:18:12 2014 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐#define FORCE_DISABLE_PROFILER_LOGLEVEL // when define will forcibly disable the profiler loglevel
2    using System;
3  using System.Collections.Generic;  using System.Collections.Generic;
4  using System.ComponentModel;  using System.ComponentModel;
5  using System.Data;  using System.Data;
# Line 12  using System.IO; Line 13  using System.IO;
13  using RomCheater.PluginFramework.Core;  using RomCheater.PluginFramework.Core;
14  using RomCheater.Core;  using RomCheater.Core;
15  using RomCheater.UserSettingsSupport;  using RomCheater.UserSettingsSupport;
16    using Enterprise.Logging;
17    
18  namespace RomCheater.RVAScratchPad  namespace RomCheater.RVAScratchPad
19  {  {
# Line 26  namespace RomCheater.RVAScratchPad Line 28  namespace RomCheater.RVAScratchPad
28          IUserControlPlugin RVACalcPlugin = null;          IUserControlPlugin RVACalcPlugin = null;
29          IUserControlPlugin ScratchPadPlugin = null;          IUserControlPlugin ScratchPadPlugin = null;
30    
31            private LogLevel logging_level = LogLevel.kLogLevel_All;
32          private DeserializeDockContent m_deserializeDockContent;          private DeserializeDockContent m_deserializeDockContent;
33          //private FloatingLogWindow m_LogWindow = new FloatingLogWindow();          //private FloatingLogWindow m_LogWindow = new FloatingLogWindow();
34          //private FloatingWebBrowser m_wb = new FloatingWebBrowser();          //private FloatingWebBrowser m_wb = new FloatingWebBrowser();
# Line 47  namespace RomCheater.RVAScratchPad Line 50  namespace RomCheater.RVAScratchPad
50          public Form1(bool no_console_redirect)          public Form1(bool no_console_redirect)
51          {          {
52              InitializeComponent();              InitializeComponent();
53                this.Icon = Core.Properties.Resources.romcheater_icon;
54              SettingsSubscriber = new SettingSubscriber();              SettingsSubscriber = new SettingSubscriber();
55              SettingsSubscriber.AddSubscriber(this, RomCheater.Properties.Settings.Default);                            SettingsSubscriber.AddSubscriber(this, RomCheater.Properties.Settings.Default);              
56              load_loggerflags();              //load_loggerflags();
57              SetupDocks();              SetupDocks();
58              //LoggerInstance = m_LogWindow.Logwriter;              //LoggerInstance = m_LogWindow.Logwriter;
59              LoggerInstance = new LogWriter(!no_console_redirect);              LoggerInstance = new LogWriter();
60              LoggerInstance.CreateNewLog(false);              load_loggerflags();
             //logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);  
61              load_plugins();              load_plugins();
62              if (no_console_redirect)              //if (no_console_redirect)
63                  LoggerInstance.RedirectConsoleOutput = false;                        //    LoggerInstance.RedirectConsoleOutput = false;          
64          }          }
65          private void load_loggerflags()          private void load_loggerflags()
66          {          {
67              //logger.SetLoggingFlags(Logging.Properties.Settings.Default.LoggingFlags);              bool upgraded_flags = Logging.Properties.Settings.Default.UpgradedLogLevel;
68                if (!upgraded_flags)
69                {
70                    logging_level = new LoggingFlagsConverter(Logging.Properties.Settings.Default.LoggingFlags).ConvertFlags();
71                    Logging.Properties.Settings.Default.UpgradedLogLevel = true;
72                    Logging.Properties.Settings.Default.gLogLoggingFlags = (uint)logging_level;
73                    Logging.Properties.Settings.Default.Save();
74                }
75                logging_level = (LogLevel)Logging.Properties.Settings.Default.gLogLoggingFlags;
76  #if FORCE_ALL_LOGGING_FLAGS  #if FORCE_ALL_LOGGING_FLAGS
77              //logger.SetLoggingFlags(loggerflags.ALL);        logging_level = LogLevel.kLogLevel_All;
78  #endif  #endif
79    #if FORCE_DISABLE_PROFILER_LOGLEVEL
80                 logging_level = logging_level & ~LogLevel.kLogLevel_Profiler;
81                 logging_level = logging_level & ~LogLevel.kLogLevel_VerboseProfiler;
82    #endif
83                 gLog.CreateLog(LoggingConstants.AppFullLogPath, true, logging_level, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush), LoggerInstance.Log);
84            }
85            private void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)
86            {
87          }          }
88          private void load_plugins() { load_plugins(false); }          private void load_plugins() { load_plugins(false); }
89          private void load_plugins_silent() { load_plugins(true); }          private void load_plugins_silent() { load_plugins(true); }
# Line 248  namespace RomCheater.RVAScratchPad Line 267  namespace RomCheater.RVAScratchPad
267    
268          private void Form1_Shown(object sender, EventArgs e)          private void Form1_Shown(object sender, EventArgs e)
269          {          {
270              ////dockPanel.SuspendLayout(true);              dockPanel.SuspendLayout(true);
271              ////ShowDocks();              ////ShowDocks();
272              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), DockPanelConfig);              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), DockPanelConfig);
273              if (File.Exists(configFile))              if (File.Exists(configFile))
# Line 260  namespace RomCheater.RVAScratchPad Line 279  namespace RomCheater.RVAScratchPad
279                  }                  }
280                  catch (Exception)                  catch (Exception)
281                  {                  {
282                      this.Controls.Remove(dockPanel);                      //this.Controls.Remove(dockPanel);
283                      dockPanel = new DockPanel();                      //dockPanel = new DockPanel();
284                      dockPanel.Dock = DockStyle.Fill;                      //dockPanel.Dock = DockStyle.Fill;
285                      dockPanel.DocumentStyle = DocumentStyle.DockingWindow;                      //dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
286                      this.Controls.Add(dockPanel);                      //this.Controls.Add(dockPanel);
287                      ShowDocks();                      ShowDocks();
288                  }                  }
289              }              }
# Line 275  namespace RomCheater.RVAScratchPad Line 294  namespace RomCheater.RVAScratchPad
294    
295              if (RVACalcPlugin != null)              if (RVACalcPlugin != null)
296                  RVACalcPlugin.Activate();                  RVACalcPlugin.Activate();
297              ////dockPanel.ResumeLayout(true, true);              dockPanel.ResumeLayout(true, true);
298          }          }
299    
300          private void mnuItemExit_Click(object sender, EventArgs e)          private void mnuItemExit_Click(object sender, EventArgs e)

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

  ViewVC Help
Powered by ViewVC 1.1.22