/[RomCheater]/trunk/RomCheater/Docking/UI/UIMemoryViewer.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/UI/UIMemoryViewer.cs

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

--- trunk/RomCheater/Docking/UI/UIMemoryViewer.cs	2014/04/15 14:30:48	811
+++ trunk/RomCheater/Docking/UI/UIMemoryViewer.cs	2014/04/15 14:52:10	812
@@ -30,6 +30,7 @@
 using RomCheater.PluginFramework.Events;
 using Sojaner.MemoryScanner;
 using RomCheater.Core;
+using Enterprise.Logging;
 
 namespace RomCheater.Docking.UI
 {
@@ -92,8 +93,8 @@
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("UIMemoryViewer.BrowseMemoryRegion(int MemoryRegion): Failed to Browse Memory Region: 0x{0:x8}", MemoryRegion);
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("UIMemoryViewer.BrowseMemoryRegion(int MemoryRegion): Failed to Browse Memory Region: 0x{0:x8}", MemoryRegion);
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 return false;
             }
         }
@@ -153,12 +154,12 @@
         {
             if (this.peData.Is32bitAssembly())
             {
-                logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoAddress(0x{0:x8})", addr);
+                gLog.Verbose.Debug.WriteLine("UIMemoryViewer::GotoAddress(0x{0:x8})", addr);
                 this.CURRENT_TOP_ADDR = (ulong)(addr & 0xFFFFFFFF0);
             }
             else
             {
-                logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoAddress(0x{0:x16})", addr);
+                gLog.Verbose.Debug.WriteLine("UIMemoryViewer::GotoAddress(0x{0:x16})", addr);
                 this.CURRENT_TOP_ADDR = (ulong)(addr & (ulong)0xFFFFFFFFFFFFFFF0);
             }
             
@@ -220,18 +221,18 @@
             {
                 if (this.peData.Is32bitAssembly())
                 {
-                    logger.VerboseDebug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0:x8})", txthexGoto.ToUInt32());
+                    gLog.Verbose.Debug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0:x8})", txthexGoto.ToUInt32());
                     this.GotoAddress(txthexGoto.ToUInt32());
                 }
                 else
                 {
-                    logger.VerboseDebug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0:x16})", txthexGoto.ToUInt64());
+                    gLog.Verbose.Debug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0:x16})", txthexGoto.ToUInt64());
                     this.GotoAddress(txthexGoto.ToUInt64());
                 }
             }
             else
             {
-                logger.VerboseDebug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0})", txthexGoto.ToUInt64().ToString("X"));
+                gLog.Verbose.Debug.WriteLine("UIMemoryViewer::btnGotoAddress_Click(0x{0})", txthexGoto.ToUInt64().ToString("X"));
                 this.GotoAddress(txthexGoto.ToUInt64());
             }
             
@@ -240,7 +241,7 @@
         private void btnEditBytes_Click(object sender, EventArgs e)
         {
             byte[] data = (txtData.ByteProvider as DynamicByteProvider).Bytes.ToArray();
-            logger.Info.WriteLine("UIMemoryViewer :: editing {0} bytes", data.Length);
+            gLog.Info.WriteLine("UIMemoryViewer :: editing {0} bytes", data.Length);
             bool reenable = false;
             if (this.UpdateEnabled) reenable = true;
             this.UpdateEnabled = false;
@@ -264,7 +265,7 @@
                 //_DynamicByteProvider.Changed += new EventHandler(HexResourceViewerBytes_Changed);
                 this.WriteCurrentBytes(this.CURRENT_TOP_ADDR, editor.AsBytes);
             }
-            logger.Info.WriteLine("UIMemoryViewer :: changed {0} bytes", changed_byte_count);
+            gLog.Info.WriteLine("UIMemoryViewer :: changed {0} bytes", changed_byte_count);
             this.UpdateEnabled = reenable;
         }
         private bool ForceUpdate = false;
@@ -321,7 +322,7 @@
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("{0}.GetMemory():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
+                gLog.Error.WriteLine("{0}.GetMemory():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
             }
             finally
             {
@@ -393,7 +394,7 @@
                         }
                         catch (Exception ex)
                         {
-                            logger.Error.WriteLine("{0}.UpdateMemroyView().BuildingAsciiString:{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
+                            gLog.Error.WriteLine("{0}.UpdateMemroyView().BuildingAsciiString:{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
                             return;
                         }
                         count++;
@@ -402,12 +403,12 @@
                 }
                 catch (Exception ex)
                 {
-                    logger.Error.WriteLine("{0}.UpdateMemroyView():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
+                    gLog.Error.WriteLine("{0}.UpdateMemroyView():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString());
                     return;
                 }
                 #endregion
             }
-            catch (Exception ex) { logger.Error.WriteLine("{0}.UpdateMemroyView():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
+            catch (Exception ex) { gLog.Error.WriteLine("{0}.UpdateMemroyView():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
         }
         //private void HexResourceViewerBytes_Changed(object sender, System.EventArgs e)
         //{
@@ -436,11 +437,11 @@
                     provider.CloseProvider();
                 }
             }
-            catch (Exception ex) { logger.Error.WriteLine("{0}.WriteCurrentBytes():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
+            catch (Exception ex) { gLog.Error.WriteLine("{0}.WriteCurrentBytes():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
         }
 
         private void update_timer_Tick(object sender, EventArgs e) { this.UpdateGui(); }
-        private void ResultsUpdateWorkerThread_DoWork(object sender, DoWorkEventArgs e) { try { this.UpdateMemroyView(); } catch (Exception ex) { logger.Error.WriteLine("{0}.ResultsUpdateWorkerThread_DoWork():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); } }
+        private void ResultsUpdateWorkerThread_DoWork(object sender, DoWorkEventArgs e) { try { this.UpdateMemroyView(); } catch (Exception ex) { gLog.Error.WriteLine("{0}.ResultsUpdateWorkerThread_DoWork():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); } }
         private void ResultsUpdateWorkerThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
             try
@@ -452,7 +453,7 @@
                 //_DynamicByteProvider.Changed += new EventHandler(HexResourceViewerBytes_Changed);
             }
             catch (ObjectDisposedException) { } // ignore errors aobut disposed objects (usually only happens when the parent closes)
-            catch (Exception ex) { logger.Error.WriteLine("{0}.ResultsUpdateWorkerThread_RunWorkerCompleted():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
+            catch (Exception ex) { gLog.Error.WriteLine("{0}.ResultsUpdateWorkerThread_RunWorkerCompleted():{1}{2}", this.GetType().Name, System.Environment.NewLine, ex.ToString()); }
         }
         private void Handle_KeyDown(object sender, KeyEventArgs e)
         {
@@ -643,7 +644,7 @@
             {
                 ImageBase = this.peData._VirtualImageBase;
                 uint ib = Convert.ToUInt32(ImageBase);
-                logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x8})", ib);
+                gLog.Verbose.Debug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x8})", ib);
                 txthexGoto.Value = ib;
                 this.GotoAddress(txthexGoto.ToUInt32());
             }
@@ -651,7 +652,7 @@
             {
                 ImageBase = this.peData._VirtualImageBase;
                 ulong ib = Convert.ToUInt64(ImageBase);
-                logger.VerboseDebug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x16})", ib);
+                gLog.Verbose.Debug.WriteLine("UIMemoryViewer::GotoImageBase(0x{0:x16})", ib);
                 txthexGoto.Value = (ulong)ib;
                 this.GotoAddress(txthexGoto.ToUInt64());
             }

 

  ViewVC Help
Powered by ViewVC 1.1.22