-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
69 lines (63 loc) · 2.1 KB
/
Copy pathProgram.cs
File metadata and controls
69 lines (63 loc) · 2.1 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
63
64
65
66
67
68
69
using System;
using System.Threading;
using OpenVisionLab;
namespace MvcVisionSystem
{
static class Program
{
/// <summary>
/// 해당 애플리케이션의 주 진입점입니다.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (HeadlessRuntimeCommandService.TryExecute(args, Console.Out, out int headlessExitCode))
{
Environment.ExitCode = headlessExitCode;
return;
}
RuntimeDiagnosticsService.ConfigureApplicationStartup();
OpenVisionLanguageService.Load();
using (Mutex mutex = new Mutex(true, "OpenVisionLab.LabelingStudio", out bool bNew))
{
if (!bNew)
{
MessageDialogService.ShowdialogMessageBox("Program Already Running", "Check Job Process");
return;
}
try
{
RunApplication();
}
finally
{
mutex.ReleaseMutex();
}
}
}
private static void RunApplication()
{
RunWpfApplication();
}
private static void RunWpfApplication()
{
System.Windows.Application application = System.Windows.Application.Current ?? new System.Windows.Application();
application.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
try
{
Yolo.AnnotationFilePersistence.ConfigureRecoveryDirectory(System.IO.Path.Combine(
RuntimeDiagnosticsPaths.Resolve().ApplicationDataRoot, "AnnotationTransactions"));
application.Run(new WpfLabelingShellWindow());
}
catch (Exception Desc)
{
AppLog.ABNORMAL("Ex ==> {0}", Desc.Message);
Environment.ExitCode = 1;
}
finally
{
LabelingApplicationState.Inst.StopPythonModelClientConnection();
}
}
}
}