birbmap/MQTTnet.TestApp.WinForm/Program.cs

46 lines
1.3 KiB
C#
Raw Permalink Normal View History

2020-11-08 18:51:19 +01:00
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Haemmer Electronics">
// Copyright (c) 2020 All rights reserved.
// </copyright>
// <summary>
// The main program.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace MQTTnet.TestApp.WinForm
{
using System;
2020-11-11 16:55:50 +01:00
using System.Threading;
2020-11-08 18:51:19 +01:00
using System.Windows.Forms;
/// <summary>
/// The main program.
/// </summary>
internal static class Program
{
2020-11-11 16:55:50 +01:00
static readonly Mutex mutex = new Mutex(true, "{B9D725A5-48F1-4907-974F-B6C3B9C8C4BB}");
2020-11-08 18:51:19 +01:00
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
2020-11-11 16:55:50 +01:00
if (!mutex.WaitOne(TimeSpan.Zero, true))
return;
try
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
finally
{
mutex.ReleaseMutex();
}
2020-11-08 18:51:19 +01:00
}
}
}