示例#1
0
 private void fctCheckUpdate(object x)
 {
     if (CmdCheckUpdate.CanExecute(x))
     {
         AppUpdater.CheckForUpdates(false);
     }
 }
        private void init()
        {
            if (Options.CheckUpdateAtStartup)
            {
                AppUpdater.CheckForUpdates(true, dra =>
                {
                    bool is3DRunning = this.Is3DActive;
                    if (is3DRunning)
                    {
                        this.Dispatcher.Invoke(() =>
                        {
                            this.Is3DActive    = false;
                            this.isAboutOpened = true;
                        });
                    }
                    dra?.Invoke();
                    if (is3DRunning)
                    {
                        this.Dispatcher.Invoke(() =>
                        {
                            this.isAboutOpened = false;
                            if (App.Current != null)
                            {
                                this.Is3DActive = true;
                            }
                        });
                    }
                });
            }
            if (!Options.HideAboutOnStartup)
            {
                AboutWindow.Instance.ShowDialog();
            }

            this.keyboardHook          = new GlobalKeyboardHook();
            this.keyboardHook.KeyDown += KeyboardHook_KeyDown;

            this.cursorSbS = new CursorSbS();

            this.backgroundWindow = new BackgroundWindow();

            this.Is3DActive = true;

            this.threadUpdateWindows = new Thread(asyncUpdateWindows);
            this.threadUpdateWindows.IsBackground = true;
            this.threadUpdateWindows.Start();
        }