Widow – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System;
19 office 2 using System.Threading;
1 office 3 using System.Windows.Forms;
4  
5 namespace Widow
6 {
7 internal class Program : IDisposable
8 {
9 #region Static Fields and Constants
10  
19 office 11 private static readonly Mutex Mutex = new Mutex(true, Constants.AssemblyGuid);
12  
1 office 13 private static Form _form;
14  
15 #endregion
16  
17 #region Constructors, Destructors and Finalizers
18  
19 public void Dispose()
20 {
21 _form?.Dispose();
22 _form = null;
23 }
24  
25 #endregion
26  
27 #region Private Methods
28  
29 /// <summary>
30 /// The main entry point for the application.
31 /// </summary>
32 [STAThread]
33 private static void Main()
34 {
19 office 35 if (Mutex.WaitOne(TimeSpan.Zero, true))
36 {
20 office 37 Application.EnableVisualStyles();
19 office 38 Application.SetCompatibleTextRenderingDefault(false);
39 _form = new MainForm();
40 Application.Run();
41 Mutex.ReleaseMutex();
42 return;
43 }
44  
45 // Foreground current other application window.
46 Natives.PostMessage(
47 (IntPtr) Natives.HWND_BROADCAST,
48 Natives.WM_SHOWME,
49 IntPtr.Zero,
50 IntPtr.Zero);
1 office 51 }
52  
53 #endregion
54 }
55 }