예제 #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Version win10Version = Util.GetWindowsVersion();

            if (win10Version.Major < 10 || (win10Version.Major == 10 && win10Version.Build < 15063))
            {
                View.VersionWarningWindow vww = new View.VersionWarningWindow();
                vww.ShowDialog();
                this.Shutdown(1);
            }

            if (!mutex.WaitOne(TimeSpan.Zero, true))
            {
                MessageBox.Show("Only one instance of DesktopSbS can run");
                this.Shutdown(1);
            }
            else
            {
                this.MainWindow = new View.MainVoidWindow();
            }
        }
예제 #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            App.Current.DispatcherUnhandledException   += Current_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            if (e.Args.FirstOrDefault()?.ToLower() == "/read-settings")
            {
                string settings = Util.ReadSettings();
                Console.WriteLine(settings);
                this.Shutdown(1);
            }

            Version win10Version = Util.GetWindowsVersion();

            if (win10Version == null)
            {
                MessageBox.Show("Windows OS version cannot be read");
            }
            else if (win10Version.Major < 10 || (win10Version.Major == 10 && win10Version.Build < 15063))
            {
                View.VersionWarningWindow vww = new View.VersionWarningWindow();
                vww.ShowDialog();
                this.Shutdown(1);
            }

            if (!mutex.WaitOne(TimeSpan.Zero, true))
            {
                MessageBox.Show("Only one instance of DesktopSbS can run");
                this.Shutdown(1);
            }
            else
            {
                this.MainWindow = new View.MainVoidWindow();
            }
        }