static void Main()
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            var view      = new LauncherView();
            var presenter = new LauncherPresenter(view);

            System.Windows.Forms.Application.Run(view);
        }
Beispiel #2
0
        private void ShowToolLauncher()
        {
            Dispatcher.BeginInvoke((Action)(() =>
            {
                var launcher = new LauncherView()
                {
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    Owner = this
                };

                if (launcher.ShowDialog() == true)
                {
                    if (launcher.SelectedToolType.HasValue)
                    {
                        AddTool(launcher.SelectedToolType.Value);
                    }
                }
            }));
        }
        public void InitializeOnceAtStartup(ZkooTutorialModel zkooTutorialModel)
        {
            Trace.Assert(zkooTutorialModel != null);
            refToZkooTutorialModel = zkooTutorialModel;

            LauncherView.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial00ZkooSetupTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial01StartGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial01StartGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial01StartGestureTraining);
            Tutorial02MoveCursorTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial02MoveCursorTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial02MoveCursorTraining);
            Tutorial03TapGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial03TapGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial03TapGestureTraining);
            Tutorial04DragGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial04DragGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial04DragGestureTraining);
            Tutorial05FlickGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial05FlickGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial05FlickGestureTraining);
            Tutorial06BothHandsGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);

            UpdatePagesSize();

            Tutorial00ZkooSetupTutorialVideo.Loaded        += delegate { OnTutorial00Moved(); };
            Tutorial01StartGestureTutorialVideo.Loaded     += delegate { OnTutorial01Moved(); };
            Tutorial01StartGestureTraining.Loaded          += delegate { OnTutorial01Moved(); };
            Tutorial02MoveCursorTutorialVideo.Loaded       += delegate { OnTutorial02Moved(); };
            Tutorial02MoveCursorTraining.Loaded            += delegate { OnTutorial02Moved(); };
            Tutorial03TapGestureTutorialVideo.Loaded       += delegate { OnTutorial03Moved(); };
            Tutorial03TapGestureTraining.Loaded            += delegate { OnTutorial03Moved(); };
            Tutorial04DragGestureTutorialVideo.Loaded      += delegate { OnTutorial04Moved(); };
            Tutorial04DragGestureTraining.Loaded           += delegate { OnTutorial04Moved(); };
            Tutorial05FlickGestureTutorialVideo.Loaded     += delegate { OnTutorial05Moved(); };
            Tutorial05FlickGestureTraining.Loaded          += delegate { OnTutorial05Moved(); };
            Tutorial06BothHandsGestureTutorialVideo.Loaded += delegate { OnTutorial06Moved(); };

            this.KeyUp += (sender, e) =>
            {
                if (true)
                {
                    if (e.Key == Key.Escape)
                    {
                        ExitTutorial();
                    }
                }
            };

            this.Loaded += (sender, e) =>
            {
                refToZkooTutorialModel.EnableUpdatingCameraViewImageButHideWindow();
            };

            cursorMonitorTimer.Tick += (sender, e) =>
            {
                if (refToZkooTutorialModel.RefToHostApp.OnePersonBothHandsViewModel == null)
                {
                    return;
                }
                var hand = refToZkooTutorialModel.RefToHostApp.OnePersonBothHandsViewModel.FirstFoundHand;
                if (hand == null || hand.IsTracking == false)
                {
                    return;
                }
                NativeMethods.SetCursorPos((int)hand.PositionX, (int)hand.PositionY);
            };
            cursorMonitorTimer.Start();
        }