/[EmuXPortal]/trunk/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Form1.cs

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

--- trunk/EmuXPortal/Form1.cs	2012/04/04 05:58:04	33
+++ trunk/EmuXPortal/Form1.cs	2012/04/04 07:21:54	37
@@ -101,6 +101,8 @@
             if (!platform_flow.Visible) return;
             platform_flow.Controls.Clear();
             platform_flow.BringToFront();
+            Stopwatch t = new Stopwatch();
+            t.Start();
             PlatformParser parser = new PlatformParser(Config.RomPath);           
             foreach (IEmuConfig config in parser.Platforms)
             {
@@ -111,13 +113,14 @@
                 platform_ctrl.PlatformImage = config.PlatformImage;
                 platform_ctrl.PlatformName = config.ToString();
                 platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);
-                platform_flow.Controls.Add(platform_ctrl);
                 platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);
                 platform_ctrl.LostFocus += new EventHandler(platform_ctrl_LostFocus);
+                platform_flow.Controls.Add(platform_ctrl);
+
             }
             platform_flow.Controls[0].Select();
-            (platform_flow.Controls[0] as PlatformControl).BorderStyle = BorderStyle.FixedSingle;            
-
+            (platform_flow.Controls[0] as PlatformControl).BorderStyle = BorderStyle.FixedSingle;
+            logger.WriteLine("PlatformParser took: {0}s to parse platforms", (int)t.Elapsed.TotalSeconds);
         }
 
         private void rom_flow_VisibleChanged(object sender, EventArgs e)
@@ -125,6 +128,8 @@
             if (!rom_flow.Visible) return;
             rom_flow.Controls.Clear();
             rom_flow.BringToFront();
+            Stopwatch t = new Stopwatch();
+            t.Start();
             RomParser parser = new RomParser(CurrentSelectedRom);
             foreach (IRomConfig config in parser.Roms)
             {
@@ -135,12 +140,15 @@
                 game_ctrl.GameImage = config.RomImage;
                 game_ctrl.GameName = config.RomTitle;
                 game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);
-                rom_flow.Controls.Add(game_ctrl);
                 game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);
                 game_ctrl.LostFocus += new EventHandler(game_ctrl_LostFocus);
+                rom_flow.Controls.Add(game_ctrl);
+                rom_flow.Update();    
             }
             rom_flow.Controls[0].Select();
             (rom_flow.Controls[0] as GameControl).BorderStyle = BorderStyle.FixedSingle;
+            t.Stop();
+            logger.WriteLine("RomParser took: {0}s to parse roms", (int)t.Elapsed.TotalSeconds);
         }
 
         void game_ctrl_LostFocus(object sender, EventArgs e)

 

  ViewVC Help
Powered by ViewVC 1.1.22