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 |
{ |
{ |
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) |
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 |
{ |
{ |
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) |