/[EmuXPortal]/branches/mono/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /branches/mono/EmuXPortal/Form1.cs

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

revision 33 by william, Wed Apr 4 05:58:04 2012 UTC revision 37 by william, Wed Apr 4 07:21:54 2012 UTC
# Line 101  namespace EmuXPortal Line 101  namespace EmuXPortal
101              if (!platform_flow.Visible) return;              if (!platform_flow.Visible) return;
102              platform_flow.Controls.Clear();              platform_flow.Controls.Clear();
103              platform_flow.BringToFront();              platform_flow.BringToFront();
104                Stopwatch t = new Stopwatch();
105                t.Start();
106              PlatformParser parser = new PlatformParser(Config.RomPath);                        PlatformParser parser = new PlatformParser(Config.RomPath);          
107              foreach (IEmuConfig config in parser.Platforms)              foreach (IEmuConfig config in parser.Platforms)
108              {              {
# Line 111  namespace EmuXPortal Line 113  namespace EmuXPortal
113                  platform_ctrl.PlatformImage = config.PlatformImage;                  platform_ctrl.PlatformImage = config.PlatformImage;
114                  platform_ctrl.PlatformName = config.ToString();                  platform_ctrl.PlatformName = config.ToString();
115                  platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);                  platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);
                 platform_flow.Controls.Add(platform_ctrl);  
116                  platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);                  platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);
117                  platform_ctrl.LostFocus += new EventHandler(platform_ctrl_LostFocus);                  platform_ctrl.LostFocus += new EventHandler(platform_ctrl_LostFocus);
118                    platform_flow.Controls.Add(platform_ctrl);
119    
120              }              }
121              platform_flow.Controls[0].Select();              platform_flow.Controls[0].Select();
122              (platform_flow.Controls[0] as PlatformControl).BorderStyle = BorderStyle.FixedSingle;                          (platform_flow.Controls[0] as PlatformControl).BorderStyle = BorderStyle.FixedSingle;
123                logger.WriteLine("PlatformParser took: {0}s to parse platforms", (int)t.Elapsed.TotalSeconds);
124          }          }
125    
126          private void rom_flow_VisibleChanged(object sender, EventArgs e)          private void rom_flow_VisibleChanged(object sender, EventArgs e)
# Line 125  namespace EmuXPortal Line 128  namespace EmuXPortal
128              if (!rom_flow.Visible) return;              if (!rom_flow.Visible) return;
129              rom_flow.Controls.Clear();              rom_flow.Controls.Clear();
130              rom_flow.BringToFront();              rom_flow.BringToFront();
131                Stopwatch t = new Stopwatch();
132                t.Start();
133              RomParser parser = new RomParser(CurrentSelectedRom);              RomParser parser = new RomParser(CurrentSelectedRom);
134              foreach (IRomConfig config in parser.Roms)              foreach (IRomConfig config in parser.Roms)
135              {              {
# Line 135  namespace EmuXPortal Line 140  namespace EmuXPortal
140                  game_ctrl.GameImage = config.RomImage;                  game_ctrl.GameImage = config.RomImage;
141                  game_ctrl.GameName = config.RomTitle;                  game_ctrl.GameName = config.RomTitle;
142                  game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);                  game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);
                 rom_flow.Controls.Add(game_ctrl);  
143                  game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);                  game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);
144                  game_ctrl.LostFocus += new EventHandler(game_ctrl_LostFocus);                  game_ctrl.LostFocus += new EventHandler(game_ctrl_LostFocus);
145                    rom_flow.Controls.Add(game_ctrl);
146                    rom_flow.Update();    
147              }              }
148              rom_flow.Controls[0].Select();              rom_flow.Controls[0].Select();
149              (rom_flow.Controls[0] as GameControl).BorderStyle = BorderStyle.FixedSingle;              (rom_flow.Controls[0] as GameControl).BorderStyle = BorderStyle.FixedSingle;
150                t.Stop();
151                logger.WriteLine("RomParser took: {0}s to parse roms", (int)t.Elapsed.TotalSeconds);
152          }          }
153    
154          void game_ctrl_LostFocus(object sender, EventArgs e)          void game_ctrl_LostFocus(object sender, EventArgs e)

Legend:
Removed from v.33  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.22