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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (hide annotations) (download)
Mon Aug 4 10:07:53 2014 UTC (5 years, 6 months ago) by william
Original Path: trunk/EmuXPortal/Form1.cs
File size: 26490 byte(s)
+ enable cursor hiding
+ disable config testing
** this will be re-released at v1.0.0.7

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

  ViewVC Help
Powered by ViewVC 1.1.22