App.xaml.cs
上传用户:liuqi822
上传日期:2022-03-21
资源大小:88k
文件大小:1k
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Data;
- using System.Linq;
- using System.Windows;
- using System.Globalization;
- using System.Runtime.InteropServices;
- namespace Screensaver1
- {
- /// <summary>
- /// Interaction logic for App.xaml
- /// </summary>
- public partial class App : Application
- {
- private void Application_Startup(object sender, StartupEventArgs e)
- {
- if (e.Args.Length > 0)
- {
- string mode = e.Args[0].ToLower(CultureInfo.InvariantCulture);
- if (mode.StartsWith("/c"))
- {
- ShowConfiguration();
- return;
- }
- else if (mode.StartsWith("/p"))
- {
- ShowPreview();
- return;
- }
- }
- ShowScreensaver();
- }
- private void ShowScreensaver()
- {
- ScreensaverWindow screensaver = new ScreensaverWindow();
- screensaver.Show();
- }
- private void ShowPreview()
- {
- Application.Current.Shutdown();
- }
- private void ShowConfiguration()
- {
- SettingsWindow settings = new SettingsWindow();
- settings.Show();
- }
- }
- }