private void ReaderOverlayWindow_OnClosing(object sender, CancelEventArgs e)
 {
     if (_laserPointerWndCtx != null)
     {
         _laserPointerWndCtx.Dispose();
         _laserPointerWndCtx = null;
     }
 }
        private void BrowserOverlayWindow_OnClosing(object sender, CancelEventArgs e)
        {
            _dispTimer.Stop();
            _dispTimer.Tick -= _dispTimer_Tick;

            if (_laserPointerWndCtx != null)
            {
                _laserPointerWndCtx.Dispose();
                _laserPointerWndCtx = null;
            }
        }
Beispiel #3
0
        void ToggleLocalLaserPointer()
        {
            if (_laserPointerWndCtx == null)
                _laserPointerWndCtx = new LaserPointerWndCtx(laserScene,
                    ExplanationModeMediator.Inst.CurrentTopicId != null ?
                    ExplanationModeMediator.Inst.CurrentTopicId.Value : -1,
                    LaserPointerTargetSurface.PdfReader
                );

            _laserPointerWndCtx.LocalLazerEnabled = ExplanationModeMediator.Inst.LasersEnabled;
        }
Beispiel #4
0
 public static async Task LaserMovementAsync(LaserPointerWndCtx ctx)
 {
     ctx.BotHandleAttach(new Point(700, 100));
     for (int i = 0; i < 100; i += 8)
     {
         ctx.BotHandleMove(new System.Windows.Point(700 + i, 100 + 3 * i));
         await Utils.DelayAsync(20);
     }
     for (int i = 0; i < 100; i += 8)
     {
         ctx.BotHandleMove(new System.Windows.Point(800 - i, 400 - 3 * i));
         await Utils.DelayAsync(20);
     }
 }
        public void ToggleLocalLaserPointer()
        {
            if (_laserPointerWndCtx == null)
                _laserPointerWndCtx = new LaserPointerWndCtx(laserScene,
                    ExplanationModeMediator.Inst.CurrentTopicId != null ?
                    ExplanationModeMediator.Inst.CurrentTopicId.Value : -1,
                    LaserPointerTargetSurface.WebBrowser
                );

            _laserPointerWndCtx.LocalLazerEnabled = ExplanationModeMediator.Inst.LasersEnabled;

            if (ExplanationModeMediator.Inst.LasersEnabled)
                WinAPI.SetHitTestVisible(this, visible: true);
            else
                WinAPI.SetHitTestVisible(this, visible: false);
        }
Beispiel #6
0
        void ToggleLaserPointer()
        {
            if (_laserPointerWndCtx == null)
            {
                _laserPointerWndCtx = new LaserPointerWndCtx(laserScene,
                    _topicId,
                    LaserPointerTargetSurface.ImageViewer);
            }

            if (_laserPointerWndCtx != null)
                _laserPointerWndCtx.LocalLazerEnabled = ExplanationModeMediator.Inst.LasersEnabled;
        }
Beispiel #7
0
        private void topicSelectionChanged(SelectionChangedEventArgs e)
        {
            if (_laserPointerWndCtx != null)
                _laserPointerWndCtx.Dispose();             
            _laserPointerWndCtx = new LaserPointerWndCtx(laserScene, 
                                                         CurrentTopic.Id, 
                                                         LaserPointerTargetSurface.PublicBoard);
            ExplanationModeMediator.Inst.LasersEnabled = false;

            if (CurrentTopic != null)
                ExplanationModeMediator.Inst.CurrentTopicId = CurrentTopic.Id;
            else
                ExplanationModeMediator.Inst.CurrentTopicId = null;

            CleanupEditCtx();

            if (topicNavPanel.selectedTopic == null)
                return;

            CreateEditCtx();

            //to update text 
            onStopWatch(null, null);
        }
Beispiel #8
0
        public void ToggleLaserPointer()
        {
            var expl = ExplanationModeMediator.Inst;

            bool enableLasers = expl.LasersEnabled &&
                                !expl.WebkitOpen &&
                                !expl.ImageViewerOpen;

            if (enableLasers && _laserPointerWndCtx == null)
            {
                _laserPointerWndCtx = new LaserPointerWndCtx(scene, CurrentTopic.Id,
                    LaserPointerTargetSurface.PublicBoard);
            }

            if (_laserPointerWndCtx != null)
                _laserPointerWndCtx.LocalLazerEnabled = enableLasers;

            if (editCtx != null)
                editCtx.SetListeners(!enableLasers);
        }