-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.xaml.cs
More file actions
31 lines (28 loc) · 953 Bytes
/
Copy pathApp.xaml.cs
File metadata and controls
31 lines (28 loc) · 953 Bytes
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
using System;
using System.IO;
using System.Windows;
namespace Web2AppLauncher
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
this.ShutdownMode = ShutdownMode.OnLastWindowClose;
// Если ярлык передал аргументы пути к папке приложения
if (e.Args.Length > 0)
{
string configDir = e.Args[0].Trim('"');
if (Directory.Exists(configDir))
{
AppWindow appWin = new AppWindow(configDir);
appWin.Show();
return;
}
}
// Если запустили генератор напрямую — открываем его
MainWindow mainWin = new MainWindow();
mainWin.Show();
}
}
}