Files
cms_thermo_active/Client/Program.cs
T
CMS3762\carminatini 1e56f6e6d3 - Client Configuration on XML File
- Refactoring Projects in the solution
2017-12-05 14:26:27 +01:00

56 lines
1.5 KiB
C#

using CefSharp;
using Client.Utils;
using CMS_Client.View;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CMS_Client
{
public static class Program
{
//Set the Mutef of GUID
static Mutex CmsStepMutex = new Mutex(true, "{66fa29db-925a-402b-a4c7-d3d780fb1bc3}");
[STAThread]
static void Main(string[] args)
{
//Check the first argument -> Url
if (args.Count() > 0)
{
Arguments.Url = args[0];
}
//Check if is already running an instance of this application
if (!CmsStepMutex.WaitOne(TimeSpan.Zero, true))
{
MessageBox.Show("Only one istance of " + Application.ProductName + " can be executed!",
Application.ProductName,
MessageBoxButtons.OK,
MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1
);
Environment.Exit(0);
}
//Run the Loading Form
Application.Run(new LoadingForm());
//Run the Main-Browser Form
Application.Run(new MainForm());
NcWindow.ShowTaskBar();
}
}
}