-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
34 lines (30 loc) · 1.23 KB
/
Main.cs
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
namespace Hbo.Sheepish
{
using Standard;
using System;
using System.Windows;
public static class Sheepish
{
[STAThread]
public static void Main()
{
if (SingleInstance.InitializeAsFirstInstance("Sheepish"))
{
// Explicitly set this to ensure the taskbar icon gets set properly, even if the app is pinned to the taskbar.
// Otherwise when pinned the shell will display the application's icon rather than the Window's.
NativeMethods.SetCurrentProcessExplicitAppUserModelID("Sheepish-" + Guid.NewGuid().ToString());
var application = new Hbo.Sheepish.App();
application.InitializeComponent();
application.Run();
// Allow single instance code to perform cleanup operations
SingleInstance.Cleanup();
}
else if (System.Diagnostics.Debugger.IsAttached)
{
MessageBox.Show(
"The application was started but the startup arguments are being delegated to another running instance.",
"Sheepish", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
}
}