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