示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ymutex = new Mutex(true, "Ying Client", out bool ret);
            if (!ret)
            {
                MessageBox.Show("已经有一个我在运行了", "(>ㅂ< )", MessageBoxButton.OK, MessageBoxImage.Information);
                this.Shutdown(0);
            }


            if (!File.Exists("bass.dll"))
            {
                YingTools.YExtractResFile("Ying.yresources.yplugins.bass.dll", "bass.dll");
                File.SetAttributes("bass.dll", FileAttributes.Hidden); //设置为隐藏文件
            }

            YingConfig.Load();
            YingConfig.YArgs.Versions = new ObservableCollection <Version>();

            InitializeLauncherCore();
            InitializeThemeColor();

            Dispatcher.UnhandledException += UnhandledExceptionHandler;

            base.OnStartup(e);
        }
示例#2
0
 protected override void OnExit(ExitEventArgs e)
 {
     YingConfig.YArgs.ThemeColor = Resources["ThemeColor"].ToString();
     YingConfig.Save();
     base.OnExit(e);
 }