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

Annotation of /trunk/EmuXPortal/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 183 - (hide annotations) (download)
Mon Aug 4 09:46:22 2014 UTC (6 years ago) by william
File size: 26608 byte(s)


1 william 181 #define DISABLE_CURSOR_HIDE // when this is present, the cursor will not be hidden
2 william 183 //#define DISABLE_PROGRESS_PERCENTAGE_MESSASGE // when this is present, no progress percent message will be shown on any progressbar
3 william 181 using System;
4 william 4 using System.Collections.Generic;
5     using System.ComponentModel;
6     using System.Data;
7     using System.Drawing;
8     using System.Linq;
9     using System.Text;
10     using System.Windows.Forms;
11 william 12 using EmuXPortal.Api;
12 william 17 using EmuXPortal.Logging;
13 william 23 using System.Diagnostics;
14 william 60 using System.Reflection;
15     using System.Threading;
16 william 183 using Utilities.TransparentControls;
17 william 4
18     namespace EmuXPortal
19     {
20     public partial class Form1 : Form
21     {
22 william 183 const float PROGRESS_BAR_FONT_SIZE = 24;
23     private delegate Font Delegate_GetFormFont();
24     private delegate Font Delegate_ResizeFont(Font font, float size);
25 william 17 IEmuConfig CurrentSelectedRom = null;
26 william 31 PlatformControl CurrentPlatformControl = null;
27     GameControl CurrentGameControl = null;
28 william 112 logger log = new logger();
29 william 4 public Form1()
30     {
31     InitializeComponent();
32 william 17 platform_flow.Dock = DockStyle.Fill;
33     rom_flow.Dock = DockStyle.Fill;
34 william 112 log.OpenLog();
35 william 4 }
36 william 17
37     private void Form1_Load(object sender, EventArgs e)
38     {
39 william 112 Config.LoadConfig(log);
40 william 172 Config.InitializePresentationForm(log,this);
41 william 17 }
42 william 181 private void Form1_Shown(object sender, EventArgs e)
43     {
44     platform_flow.Visible = true;
45     #if !DISABLE_CURSOR_HIDE
46     Cursor.Hide();
47     #else
48     Cursor.Show();
49     #endif
50     }
51 william 17 void platform_ctrl_LostFocus(object sender, EventArgs e)
52     {
53     PlatformControl c = sender as PlatformControl;
54     c.BorderStyle = BorderStyle.None;
55     }
56 william 13
57 william 17 void platform_ctrl_GotFocus(object sender, EventArgs e)
58 william 13 {
59 william 17 PlatformControl c = sender as PlatformControl;
60     c.BorderStyle = BorderStyle.FixedSingle;
61 william 31 CurrentPlatformControl = c;
62 william 13 }
63 william 168 void game_ctrl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
64     {
65     GameControl c = sender as GameControl;
66 william 17
67 william 168 int changeAmount = 0;
68     int currentPosition = 0;
69 william 183 if (e.KeyCode == Keys.F && (e.Modifiers & Keys.Control) == Keys.Control)
70 william 168 {
71     IRomConfig config = c.Tag as IRomConfig;
72     if (config == null)
73     {
74     log.WriteLine("Unable to add/remove from/to favorites (config is null): {0} [{1}]", config.RomTitle, config.RomFile);
75     }
76     else
77     {
78 william 169 var isFavorite = RomFavorite.IsFavorite(log, config);
79 william 168 if (isFavorite)
80     {
81     // add to favorites
82     log.WriteLine("Removing from favorites: {0} [{1}]", config.RomTitle, config.RomFile);
83 william 169 if (!RomFavorite.RemoveFavorite(log, config))
84 william 168 {
85     log.WriteLine("Failed to remove from favorites: {0} [{1}]", config.RomTitle, config.RomFile);
86     }
87     else
88     {
89     log.WriteLine("Removed from favorites: {0} [{1}]", config.RomTitle, config.RomFile);
90 william 177 if (config.Config.PlatformNameShort == "Favorites")
91 william 176 {
92 william 177 var parent = c.Parent;
93     if (parent != null)
94 william 176 {
95 william 177 parent.Controls.Remove(c);
96     if (parent.Controls.Count > 0)
97 william 176 {
98 william 177 var next_ctrl = parent.Controls[0];
99     if (next_ctrl != null)
100     {
101     next_ctrl.Select();
102     }
103 william 176 }
104     }
105 william 177 }
106 william 168 }
107     }
108     else
109     {
110     // add to favorites
111     log.WriteLine("Adding to favorites: {0} [{1}]", config.RomTitle, config.RomFile);
112 william 169 if (!RomFavorite.AddFavorite(log,config))
113 william 168 {
114     log.WriteLine("Failed to add to favorites: {0} [{1}]", config.RomTitle, config.RomFile);
115     }
116     else
117     {
118     log.WriteLine("Added to favorites: {0} [{1}]", config.RomTitle, config.RomFile);
119     }
120     }
121     log.WriteLine("Updateing favorites");
122 william 169 if (!RomFavorite.UpdateFavorites(log))
123 william 168 {
124     log.WriteLine("Failed to update favorites");
125     }
126     else
127     {
128     log.WriteLine("Updated favorites");
129     }
130     }
131     return; // stop processing other keys
132    
133     }
134     if (e.KeyCode == Keys.Home)
135     {
136     rom_flow.Controls[0].Select();
137     rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
138     }
139     if (e.KeyCode == Keys.End)
140     {
141     rom_flow.Controls[rom_flow.Controls.Count - 1].Select();
142     rom_flow.ScrollControlIntoView(rom_flow.Controls[rom_flow.Controls.Count - 1]);
143     }
144     if (e.KeyCode == Keys.PageUp)
145     {
146     changeAmount = rom_flow.VerticalScroll.LargeChange;
147     currentPosition = rom_flow.VerticalScroll.Value;
148     if ((currentPosition - changeAmount) > rom_flow.VerticalScroll.Minimum)
149     {
150     try
151     {
152 william 179 rom_flow.VerticalScroll.Value -= changeAmount;
153 william 168 }
154     catch
155     {
156     rom_flow.Controls[0].Select();
157 william 179 rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
158 william 168 rom_flow.PerformLayout();
159     return;
160     }
161     }
162     else
163     {
164     rom_flow.Controls[0].Select();
165 william 179 rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
166 william 168 }
167     GameControl s = game_ctrl_get_last_visible();
168     s.Select();
169     rom_flow.ScrollControlIntoView(s);
170     rom_flow.PerformLayout();
171     }
172     if (e.KeyCode == Keys.PageDown)
173     {
174     changeAmount = rom_flow.VerticalScroll.LargeChange;
175     currentPosition = rom_flow.VerticalScroll.Value;
176     if ((currentPosition - changeAmount) < rom_flow.VerticalScroll.Maximum)
177     {
178     rom_flow.VerticalScroll.Value += changeAmount;
179     }
180     else
181     {
182     rom_flow.VerticalScroll.Value = rom_flow.VerticalScroll.Maximum;
183     }
184     GameControl s = game_ctrl_get_last_visible();
185     s.Select();
186     rom_flow.ScrollControlIntoView(s);
187     rom_flow.PerformLayout();
188     }
189    
190     if (e.KeyCode == Keys.Enter)
191     {
192     IRomConfig config = c.Tag as IRomConfig;
193    
194     Process p = new Process();
195    
196     p.StartInfo.FileName = config.Config.GameExe == "" ? config.Config.EmuPath : config.Config.GameExe;
197     p.StartInfo.Arguments = config.Config.GameExeArgs == "" ? EmuConfigLoader.GetEMUOptions(log, config) : config.Config.GameExeArgs;
198     p.Start();
199    
200     // minimize EmuXPortal
201     this.WindowState = FormWindowState.Minimized;
202     // wait for exit of game
203     p.WaitForExit();
204     // maximize EmuXPortal
205     this.WindowState = FormWindowState.Maximized;
206     }
207     if (e.KeyCode == Keys.Back)
208     {
209     rom_flow.Visible = false;
210     platform_flow.Visible = true;
211     }
212    
213     if ((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) ||
214     (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9))
215     {
216     char t = (char)e.KeyCode;
217 william 181 GameControl ctrl = (rom_flow.GetNextControl(CurrentGameControl, true) as GameControl);
218 william 168 if (ctrl == null) { ctrl = (rom_flow.GetNextControl(rom_flow.Controls[0], true) as GameControl); }
219     bool found = false;
220     GameControl pc = CurrentGameControl;
221     bool wrapped = false;
222     bool not_found = true;
223     while (!found)
224     {
225     if (wrapped)
226     {
227     foreach (Control ctl in rom_flow.Controls)
228     {
229     GameControl p_ctl = ctl as GameControl; if (p_ctl.GameName.ToLower().StartsWith(t.ToString().ToLower())) { not_found = false; }
230     }
231     if (not_found) { found = true; }
232     }
233     ctrl = (rom_flow.GetNextControl(pc, true) as GameControl);
234     if (ctrl == null)
235     {
236     ctrl = rom_flow.Controls[0] as GameControl;
237     wrapped = true;
238     }
239     if (ctrl.GameName.ToLower().StartsWith(t.ToString().ToLower()))
240     {
241     rom_flow.ScrollControlIntoView(ctrl);
242     ctrl.Select();
243     found = true;
244     }
245     pc = ctrl;
246     }
247     }
248     }
249 william 17 void platform_ctrl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
250     {
251     PlatformControl c = sender as PlatformControl;
252 william 60 int changeAmount = 0;
253     int currentPosition = 0;
254     if (e.KeyCode == Keys.Home)
255     {
256     platform_flow.Controls[0].Select();
257     platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
258     }
259     if (e.KeyCode == Keys.End)
260     {
261     platform_flow.Controls[platform_flow.Controls.Count -1].Select();
262     platform_flow.ScrollControlIntoView(platform_flow.Controls[platform_flow.Controls.Count - 1]);
263     }
264     if (e.KeyCode == Keys.PageUp)
265     {
266     changeAmount = platform_flow.VerticalScroll.LargeChange;
267     currentPosition = platform_flow.VerticalScroll.Value;
268     if ((currentPosition - changeAmount) > platform_flow.VerticalScroll.Minimum)
269     {
270     platform_flow.VerticalScroll.Value -= changeAmount;
271     }
272     else
273     {
274     platform_flow.VerticalScroll.Value = platform_flow.VerticalScroll.Minimum;
275     }
276     PlatformControl s = platform_ctrl_get_last_visible();
277     s.Select();
278     platform_flow.ScrollControlIntoView(s);
279     platform_flow.PerformLayout();
280     }
281     if (e.KeyCode == Keys.PageDown)
282 william 180 {
283 william 60 changeAmount = platform_flow.VerticalScroll.LargeChange;
284     currentPosition = platform_flow.VerticalScroll.Value;
285     if ((currentPosition - changeAmount) < platform_flow.VerticalScroll.Maximum)
286     {
287     try
288     {
289     platform_flow.VerticalScroll.Value += changeAmount;
290     }
291     catch
292     {
293     platform_flow.Controls[0].Select();
294     platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
295     rom_flow.PerformLayout();
296     return;
297     }
298     }
299     else
300     {
301     platform_flow.Controls[0].Select();
302     platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
303     }
304     PlatformControl s = platform_ctrl_get_last_visible();
305     s.Select();
306     platform_flow.ScrollControlIntoView(s);
307     platform_flow.PerformLayout();
308     }
309 william 17 if (e.KeyCode == Keys.Enter)
310     {
311     // load this platform
312     platform_flow.Visible = false;
313     CurrentSelectedRom = c.Tag as IEmuConfig;
314     rom_flow.Visible = true;
315     rom_flow.BringToFront();
316 william 25 }
317     if (e.KeyCode == Keys.Back)
318     {
319     this.Close();
320     }
321 william 30 if ((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) ||
322     (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9))
323     {
324     char t = (char)e.KeyCode;
325 william 31 PlatformControl ctrl = (platform_flow.GetNextControl(CurrentPlatformControl, true) as PlatformControl);
326     if (ctrl == null) { ctrl = (platform_flow.GetNextControl(platform_flow.Controls[0], true) as PlatformControl); }
327     bool found = false;
328     PlatformControl pc = CurrentPlatformControl;
329     bool wrapped = false;
330     bool not_found = true;
331     while (!found)
332 william 30 {
333 william 31 if (wrapped)
334 william 30 {
335 william 31 foreach (Control ctl in platform_flow.Controls)
336     {
337     PlatformControl p_ctl = ctl as PlatformControl; if (p_ctl.PlatformName.ToLower().StartsWith(t.ToString().ToLower())) { not_found = false; }
338     }
339     if (not_found) { found = true; }
340 william 30 }
341 william 31 ctrl = (platform_flow.GetNextControl(pc, true) as PlatformControl);
342     if (ctrl == null)
343     {
344     ctrl = platform_flow.Controls[0] as PlatformControl;
345     wrapped = true;
346     }
347     if (ctrl.PlatformName.ToLower().StartsWith(t.ToString().ToLower()))
348     {
349     platform_flow.ScrollControlIntoView(ctrl);
350     ctrl.Select();
351     found = true;
352     }
353     pc = ctrl;
354 william 30 }
355     }
356 william 17 }
357    
358     private void platform_flow_VisibleChanged(object sender, EventArgs e)
359     {
360     if (!platform_flow.Visible) return;
361     platform_flow.Controls.Clear();
362     platform_flow.BringToFront();
363 william 37 Stopwatch t = new Stopwatch();
364     t.Start();
365 william 60 platformWorker.RunWorkerAsync(t);
366 william 17 }
367    
368     private void rom_flow_VisibleChanged(object sender, EventArgs e)
369     {
370     if (!rom_flow.Visible) return;
371     rom_flow.Controls.Clear();
372     rom_flow.BringToFront();
373 william 37 Stopwatch t = new Stopwatch();
374     t.Start();
375 william 60 gameWorker.RunWorkerAsync(t);
376 william 17 }
377    
378     void game_ctrl_LostFocus(object sender, EventArgs e)
379     {
380     GameControl c = sender as GameControl;
381     c.BorderStyle = BorderStyle.None;
382     }
383    
384     void game_ctrl_GotFocus(object sender, EventArgs e)
385     {
386     GameControl c = sender as GameControl;
387     c.BorderStyle = BorderStyle.FixedSingle;
388 william 31 CurrentGameControl = c;
389 william 17 }
390    
391 william 60 private GameControl game_ctrl_get_last_visible()
392     {
393     GameControl s = new GameControl();
394     foreach (GameControl c in rom_flow.Controls)
395     {
396     if (c.Bounds.IntersectsWith(rom_flow.Bounds))
397     s = c;
398     }
399     return s;
400     }
401     private PlatformControl platform_ctrl_get_last_visible()
402     {
403     PlatformControl s = new PlatformControl();
404     foreach (PlatformControl c in platform_flow.Controls)
405     {
406     if (c.Bounds.IntersectsWith(platform_flow.Bounds))
407     s = c;
408     }
409     return s;
410     }
411 william 168
412 william 60
413     #region Background Workers
414    
415     private int GetFormWidth()
416     {
417     if (this.InvokeRequired)
418     {
419     return Convert.ToInt32(this.Invoke((MethodInvoker)delegate() { GetFormWidth(); }));
420     }
421     else
422     {
423     return this.Width;
424     }
425     }
426 william 183 private Font GetFormFont()
427     {
428     if (this.InvokeRequired)
429     {
430     return (this.Invoke(new Delegate_GetFormFont(GetFormFont)) as Font);
431     }
432     else
433     {
434     return this.Font;
435     }
436     }
437    
438     private Font ResizeFont(Font font, float size)
439     {
440     if (this.InvokeRequired)
441     {
442     return (this.Invoke(new Delegate_ResizeFont(ResizeFont), new object[] { font, size })as Font);
443     }
444     else
445     {
446     return new Font(font.FontFamily, size);
447     }
448     }
449    
450 william 113 //private void AddPlatformControl(Control c)
451     //{
452     // if (platform_flow.InvokeRequired) { platform_flow.Invoke((MethodInvoker)delegate() { AddPlatformControl(c); }); }
453     // else
454     // {
455     // platform_flow.Controls.Add(c);
456     // }
457     //}
458     //private void UpdatePlatformControls()
459     //{
460     // //if (platform_flow.InvokeRequired) { platform_flow.Invoke((MethodInvoker)delegate() { UpdatePlatformControls(); }); }
461     // //else { this.Update(); }
462     //}
463     //private void AddGameControl(Control c)
464     //{
465     // if (rom_flow.InvokeRequired) { rom_flow.Invoke((MethodInvoker)delegate() { AddGameControl(c); }); }
466     // else
467     // {
468     // rom_flow.Controls.Add(c);
469     // }
470     //}
471     //private void UpdateGameControls()
472     //{
473     // //if (rom_flow.InvokeRequired) { rom_flow.Invoke((MethodInvoker)delegate() { UpdateGameControls(); }); }
474     // //else { this.Update(); }
475     //}
476 william 60 #region gameWorker
477 william 110 private static Image DefaultGameImage = Properties.Resources.DefaultGameImage;
478 william 137 private object gameimage_lock = new object();
479 william 60 private void gameWorker_DoWork(object sender, DoWorkEventArgs e)
480     {
481     Stopwatch t = e.Argument as Stopwatch;
482 william 112 RomParser parser = new RomParser(log, CurrentSelectedRom);
483 william 60
484 william 183 CustomProgressBar bar = new CustomProgressBar();
485     bar.Font = ResizeFont(GetFormFont(), PROGRESS_BAR_FONT_SIZE);
486     #if DISABLE_PROGRESS_PERCENTAGE_MESSASGE
487     bar.ShowPercentageLabel = false;
488     #endif
489     bar.ProgressColor = Color.LimeGreen;
490     bar.Dock = DockStyle.Top;
491    
492     if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Add(bar); }); }
493     else { this.Controls.Add(bar); }
494     bar.Invoke(new MethodInvoker(delegate { bar.Margin = new System.Windows.Forms.Padding(0); bar.Size = new Size(GetFormWidth() - 25, 100); }));
495 william 60
496     double count = 0;
497     double total_count = parser.Roms.Count;
498     foreach (IRomConfig config in parser.Roms)
499     {
500 william 183 bar.Invoke(new MethodInvoker(delegate { bar.Value = (int)(100.0 * (count / total_count)); }));
501 william 60 GameControl game_ctrl = new GameControl();
502 william 183 game_ctrl.Font = GetFormFont();
503 william 60 game_ctrl.Dock = DockStyle.Top;
504     game_ctrl.Width = this.Width - 10;
505     game_ctrl.Tag = config;
506 william 137 try
507     {
508     lock (gameimage_lock)
509     {
510     game_ctrl.GameImage = config.RomImage == null ? (Image)DefaultGameImage.Clone() : (Image)config.RomImage.Clone();
511     config.ReleaseRomImageResource();
512     }
513     }
514     catch (Exception ex)
515     {
516     throw ex;
517 william 178 }
518     if (CurrentSelectedRom.PlatformNameShort == "Favorites")
519     {
520     //game_ctrl.GameName = config.RomTitle;
521     game_ctrl.GameName = RomFavorite.GetRomTitleFromConfig(config);
522     }
523     else
524     {
525     game_ctrl.GameName = config.RomTitle;
526 william 183 }
527 william 60 game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);
528     game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);
529     game_ctrl.LostFocus += new EventHandler(game_ctrl_LostFocus);
530 william 113 if (rom_flow.InvokeRequired) { rom_flow.Invoke((MethodInvoker)delegate() { rom_flow.Controls.Add(game_ctrl); }); }
531     else { rom_flow.Controls.Add(game_ctrl); }
532 william 60 count++;
533     }
534 william 183 bar.Invoke(new MethodInvoker(delegate { bar.Value = 1; bar.Update(); }));
535     if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Remove(bar); }); } else { this.Controls.Remove(bar); }
536 william 60 e.Result = t;
537 william 105 parser.Dispose();
538 william 60 }
539     private void gameWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { }
540     private void gameWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
541     {
542     Stopwatch t = e.Result as Stopwatch;
543     rom_flow.Controls.RemoveAt(0);
544     rom_flow.Controls[0].Select();
545     (rom_flow.Controls[0] as GameControl).BorderStyle = BorderStyle.FixedSingle;
546     t.Stop();
547 william 112 log.WriteLine("RomParser took: {0}s to parse roms", (int)t.Elapsed.TotalSeconds);
548 william 60 }
549     #endregion
550     #region platformWorker
551 william 110 private static Image DefaultPlatformImage = Properties.Resources.DefaultPlatformImage;
552 william 137 private object platformimage_lock = new object();
553 william 60 private void platformWorker_DoWork(object sender, DoWorkEventArgs e)
554     {
555     Stopwatch t = e.Argument as Stopwatch;
556 william 112 PlatformParser parser = new PlatformParser(log, Config.RomPath);
557 william 60 double count = 0;
558     double total_count = parser.Platforms.Count;
559 william 183 CustomProgressBar bar = new CustomProgressBar();
560     bar.Font = ResizeFont(GetFormFont(), PROGRESS_BAR_FONT_SIZE);
561     #if DISABLE_PROGRESS_PERCENTAGE_MESSASGE
562     bar.ShowPercentageLabel = false;
563     #endif
564     bar.ProgressColor = Color.LimeGreen;
565     bar.Dock = DockStyle.Top;
566     if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Add(bar); }); }
567     else { this.Controls.Add(bar); }
568     bar.Invoke(new MethodInvoker(delegate { bar.Margin = new System.Windows.Forms.Padding(0); bar.Size = new Size(GetFormWidth() - 25, 100); }));
569 william 60 foreach (IEmuConfig config in parser.Platforms)
570     {
571 william 183 bar.Invoke(new MethodInvoker(delegate { bar.Value = (int)(100.0 * (count / total_count)); }));
572    
573 william 60 PlatformControl platform_ctrl = new PlatformControl();
574 william 183 platform_ctrl.Font = GetFormFont();
575 william 60 platform_ctrl.Dock = DockStyle.Top;
576     platform_ctrl.Width = this.Width - 10;
577     platform_ctrl.Tag = config;
578 william 137 try
579     {
580     lock (platformimage_lock)
581     {
582 william 138 platform_ctrl.PlatformImage = config.PlatformImage == null ? (Image)DefaultPlatformImage.Clone() : (Image)config.PlatformImage.Clone();
583 william 137 config.ReleasePlatformImageResource();
584     }
585     }
586     catch (Exception ex)
587     {
588     throw ex;
589     }
590 william 60 platform_ctrl.PlatformName = config.ToString();
591     platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);
592     platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);
593     platform_ctrl.LostFocus += new EventHandler(platform_ctrl_LostFocus);
594 william 113 if (platform_flow.InvokeRequired) { platform_flow.Invoke((MethodInvoker)delegate() { platform_flow.Controls.Add(platform_ctrl); }); }
595 william 183 else { platform_flow.Controls.Add(platform_ctrl); }
596 william 60 count++;
597     }
598 william 183 bar.Invoke(new MethodInvoker(delegate { bar.Value = 1; bar.Update(); }));
599     if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Remove(bar); }); } else { this.Controls.Remove(bar); }
600 william 60 e.Result = t;
601 william 105 parser.Dispose();
602 william 60 }
603     private void platformWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { }
604     private void platformWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
605     {
606     Stopwatch t = e.Result as Stopwatch;
607     platform_flow.Controls[0].Select();
608 william 112 log.WriteLine("PlatformParser took: {0}s to parse platforms", (int)t.Elapsed.TotalSeconds);
609 william 60 }
610     #endregion
611    
612     private void Form1_FormClosed(object sender, FormClosedEventArgs e)
613     {
614     Cursor.Show();
615 william 112 log.CloseLog();
616 william 60 }
617     #endregion
618 william 4 }
619     }

  ViewVC Help
Powered by ViewVC 1.1.22