forked from jaysonragasa/MultiRDPClient.NET
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
62 lines (51 loc) · 1.84 KB
/
Program.cs
File metadata and controls
62 lines (51 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Microsoft.VisualBasic.ApplicationServices;
using System;
using System.Windows.Forms;
namespace MultiRemoteDesktopClient
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetCompatibleTextRenderingDefault(false);
Application.EnableVisualStyles();
AppCenter.Start("8e9dbe40-0b00-46ee-8a37-738dcb1a9e4d",
typeof(Analytics), typeof(Crashes));
#if DEBUG
Microsoft.AppCenter.Analytics.Analytics.TrackEvent("Starting in DEBUG");
#else
Microsoft.AppCenter.Analytics.Analytics.TrackEvent("Starting in RELEASE");
#endif
SingleInstanceController controler = new SingleInstanceController();
controler.Run(Environment.GetCommandLineArgs());
}
}
public class SingleInstanceController : WindowsFormsApplicationBase
{
public SingleInstanceController()
{
IsSingleInstance = true;
this.StartupNextInstance += new StartupNextInstanceEventHandler(SingleInstanceController_StartupNextInstance);
}
void SingleInstanceController_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
{
RemoteDesktopClient rdc = (RemoteDesktopClient)this.MainForm;
string[] args = new string[e.CommandLine.Count];
e.CommandLine.CopyTo(args, 0);
rdc.DoArguments(args);
}
protected override void OnCreateMainForm()
{
SplashScreenWindow ssw = new SplashScreenWindow();
ssw.ShowDialog();
this.MainForm = new RemoteDesktopClient();
}
}
}