DreamineVMS 1.0.0.0
Windows PC의 RTSP·USB 카메라 영상을 HLS로 변환해 원격 CCTV Viewer에 전달하는 데스크톱 에이전트입니다.
로딩중...
검색중...
일치하는것 없음
App.xaml.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Hybrid.Wpf.Interfaces;
4using Microsoft.Extensions.DependencyInjection;
5using System;
6using System.Windows;
7
8namespace DreamineVMS;
9
18public partial class App : Application, IDreamineServiceProviderAware
19{
28 public static IServiceProvider? ServiceProvider { get; private set; }
29
54 public void SetServiceProvider(IServiceProvider serviceProvider)
55 {
56 ServiceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
57 }
58
83 protected override void OnStartup(StartupEventArgs e)
84 {
85 base.OnStartup(e);
86
87 DispatcherUnhandledException += (_, args) =>
88 {
89 System.Windows.MessageBox.Show(
90 args.Exception.ToString(),
91 "오류 발생 — DreamineVMS",
92 System.Windows.MessageBoxButton.OK,
93 System.Windows.MessageBoxImage.Error);
94 args.Handled = true;
95 };
96
97 AppDomain.CurrentDomain.UnhandledException += (_, args) =>
98 {
99 System.Windows.MessageBox.Show(
100 args.ExceptionObject?.ToString() ?? "알 수 없는 오류",
101 "치명적 오류 — DreamineVMS",
102 System.Windows.MessageBoxButton.OK,
103 System.Windows.MessageBoxImage.Error);
104 };
105
106 if (ServiceProvider is null)
107 {
108 throw new InvalidOperationException("ServiceProvider initialization failed.");
109 }
110
111 MainWindowViewModel viewModel = ServiceProvider.GetRequiredService<MainWindowViewModel>();
112 MainWindow window = ServiceProvider.GetRequiredService<MainWindow>();
113 window.DataContext = viewModel;
114
115 MainWindow = window;
116 window.Show();
117 }
118
143 protected override void OnExit(ExitEventArgs e)
144 {
145 base.OnExit(e);
146 }
147}
static ? IServiceProvider ServiceProvider
Definition App.xaml.cs:28
void SetServiceProvider(IServiceProvider serviceProvider)
Definition App.xaml.cs:54
override void OnStartup(StartupEventArgs e)
Definition App.xaml.cs:83
override void OnExit(ExitEventArgs e)
Definition App.xaml.cs:143