-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.xaml.cs
38 lines (34 loc) · 1.2 KB
/
App.xaml.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
35
36
37
38
using Sharpsaver.Views;
using System;
using System.Windows;
namespace Sharpsaver
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs args)
{
base.OnStartup(args);
if (args.Args.Length == 0 || args.Args[0].ToLower().StartsWith("/c"))
{
//Show the configuration settings dialog box.
var settingsWindow = new SettingsView();
settingsWindow.Show();
}
else if (args.Args[0].ToLower().StartsWith("/s"))
{
//Start the screensaver in full-screen mode.
var screensaverWindow = new ScreensaverView();
screensaverWindow.Show();
}
else if (args.Args[0].ToLower().StartsWith("/p"))
{
//Display a preview of the screensaver using the specified window handle.
IntPtr previewHwnd = new IntPtr(Convert.ToInt32(args.Args[1]));
var previewWindow = new ScreensaverView(previewHwnd);
#if !NET30 && !NET35
previewWindow.Show();
#endif
}
}
}
}