public void Deinit()
        {
            //if this is local initiative, close
            if (userRequestedClosing != null)
            {
                userRequestedClosing();
            }

            _scrollStateChecker.Stop();
            _scrollStateChecker.Tick -= _scrollStateChecker_Tick;

            //browserBar.Browser = null;
            //browserBar.Window = null;

            //_webKitBrowser1.Dispose();
            //_webKitBrowser1 = null;
            _webKitBrowser1.Visible = false;

            DiscWindows.Get().ShowPublic();

            SetListeners(false);

            ExplanationModeMediator.Inst.LasersEnabled = false;

            ExplanationModeMediator.Inst.WebkitOpen = false;

            if (_overlayWnd != null)
            {
                _overlayWnd.Hide();
            }

            Hide();
        }
Beispiel #2
0
        private void btnToMainMenuClick(object sender, RoutedEventArgs e)
        {
            if (DiscWindows.Get().mainWnd != null)
            {
                DiscWindows.Get().mainWnd.Activate();
            }

            ///Close();
        }
        public ScreenshotCaptureWnd(Action <Bitmap> onCaptured)
        {
            InitializeComponent();

            DiscWindows.Get().HideOwnWindows();

            _onCaptured = onCaptured;

            // ShowPreMessage();
        }
        void Init(string pdfPathName, int attachmentId, int?topicId, bool localRequest)
        {
            _inst = this;

            DataContext = this;

            Width  = 1024;
            Height = 768;

            this.WindowState = WindowState.Normal;

            btnLaserPointer.DataContext    = ExplanationModeMediator.Inst;
            btnExplanationMode.DataContext = ExplanationModeMediator.Inst;

            _mediator         = ExplanationModeMediator.Inst;
            _mediator.PdfOpen = true;

            if (ExplanationModeMediator.Inst.ExplanationModeEnabled)
            {
                DiscWindows.Get().HidePublic();
            }

            ExplanationModeMediator.Inst.OnWndOpened(this, attachmentId, localRequest);

            if (_moonPdfLoaded)
            {
                _inst.moonPdfPanel.OpenFile(pdfPathName);
            }
            else
            {
                Utils.DelayAsync(100).GetAwaiter().OnCompleted(
                    () => _inst.moonPdfPanel.OpenFile(pdfPathName));
            }

            moonPdfPanel.ZoomType = ZoomType.FitToWidth;

            //wait the doc to load before starting sync.
            _viewStateTimer          = new DispatcherTimer();
            _viewStateTimer.Interval = TimeSpan.FromMilliseconds(100);
            _viewStateTimer.Tick    += _viewStateTimer_Tick;
            if (_mediator.ExplanationModeEnabled)
            {
                Utils.DelayAsync(100).GetAwaiter().OnCompleted(RequestScrollPosition);
                Utils.DelayAsync(150).GetAwaiter().OnCompleted(() => _viewStateTimer.Start());
            }

            if (topicId != null)
            {
                _mediator.CurrentTopicId = topicId;
            }

            SetListeners(true);
        }
Beispiel #5
0
        void Init(int attachId, int topicId, bool localRequest)
        {
            _attachId = attachId;
            _topicId  = topicId;

            ExplanationModeMediator.Inst.OnWndOpened(this, attachId, localRequest);

            //if (ExplanationModeMediator.Inst.ExplanationModeEnabled)
            //{
            //    WindowState = WindowState.Maximized;
            //}
            //else
            //{
            WindowState = WindowState.Normal;
            Width       = 1280;
            Height      = 768;
            //}

            btnExplanationMode.DataContext = ExplanationModeMediator.Inst;
            btnLaserPointer.DataContext    = ExplanationModeMediator.Inst;

            DataContext = this;

            //Width = 0.8 * System.Windows.SystemParameters.PrimaryScreenWidth;
            //Height = 0.8 * System.Windows.SystemParameters.PrimaryScreenHeight;
            //Width = 1024;
            //Height = 768;

            if (ExplanationModeMediator.Inst.ExplanationModeEnabled)
            {
                DiscWindows.Get().HidePublic();
            }

            SetTransform(Matrix.Identity);

            //we cannot use HorizontalAlignment==Center, so center the image via RenderTransform
            var op = Dispatcher.BeginInvoke((Action)(() =>
            {
                var mt = (MatrixTransform)img.RenderTransform;
                var matrix = mt.Matrix;
                matrix.Translate(0.5 * (this.ActualWidth - img.ActualWidth), 0);
                mt.Matrix = matrix;
            }),
                                            DispatcherPriority.Background);

            SetListeners(true);

            CheckSendImgStateRequest();
        }
Beispiel #6
0
        private void btnGoPrivate_Click(object sender, RoutedEventArgs e)
        {
            var wnd = DiscWindows.Get();

            if (wnd.privateDiscBoard != null)
            {
                wnd.privateDiscBoard.Activate();
                return;
            }

            wnd.privateDiscBoard = new PrivateCenter3(_sharedClient, () => { wnd.privateDiscBoard = null; });
            wnd.privateDiscBoard.Show();

            // Close();
        }
Beispiel #7
0
        private void startPrivateBoard()
        {
            var wnd = DiscWindows.Get();

            if (wnd.privateDiscBoard != null)
            {
                wnd.privateDiscBoard.Activate();
            }
            else
            {
                wnd.privateDiscBoard = new PrivateCenter3(UISharedRTClient.Instance,
                                                          () => { wnd.privateDiscBoard = null; });
                wnd.privateDiscBoard.Show();
            }
        }
Beispiel #8
0
        private void btnDiscu_Click(object sender, RoutedEventArgs e)
        {
            var wnd = DiscWindows.Get();

            if (wnd.discDashboard != null)
            {
                wnd.discDashboard.Activate();
                return;
            }

            wnd.discDashboard = new PublicCenter(_sharedClient, () => { wnd.discDashboard = null; }, -1, -1);
            wnd.discDashboard.Show();

            // Close();
        }
 private void ShowOwnWindows()
 {
     DiscWindows.Get().mainWnd.Show();
     if (DiscWindows.Get().privateDiscBoard != null)
     {
         DiscWindows.Get().privateDiscBoard.Show();
     }
     if (DiscWindows.Get().moderDashboard != null)
     {
         DiscWindows.Get().moderDashboard.Show();
     }
     if (DiscWindows.Get().htmlBackgroundWnd != null)
     {
         DiscWindows.Get().htmlBackgroundWnd.Show();
     }
 }
Beispiel #10
0
        private void startPublicBoard()
        {
            var wnd = DiscWindows.Get();

            if (wnd.discDashboard != null)
            {
                wnd.discDashboard.Activate();
            }
            else
            {
                wnd.discDashboard = new PublicCenter(UISharedRTClient.Instance,
                                                     () => { wnd.discDashboard = null; },
                                                     -1, -1
                                                     );
                wnd.discDashboard.Show();
            }
        }
Beispiel #11
0
        public void Deinit()
        {
            ExplanationModeMediator.Inst.OnWndClosed(this);

            DiscWindows.Get().ShowPublic();

            ExplanationModeMediator.Inst.LasersEnabled = false;

            SetListeners(false);

            img.Source = null;

            //if (_laserPointerWndCtx != null)
            //{
            //    _laserPointerWndCtx.Dispose();
            //    _laserPointerWndCtx = null;
            //}

            Hide();
        }
Beispiel #12
0
        private void btnEditBg_Click(object sender, RoutedEventArgs e)
        {
            DiscWindows.Get().htmlBackgroundWnd = new HtmlEditWnd(DataContext as Discussion,
                                                                  () =>
            {
                DiscWindows.Get().htmlBackgroundWnd = null;

                var d = DataContext as Discussion;
                if (d != null)
                {
                    if (d.HtmlBackground != null)
                    {
                        htmlBackground.NavigateToString(
                            d.HtmlBackground);
                    }
                }
            }
                                                                  );
            DiscWindows.Get().htmlBackgroundWnd.Show();
        }
        private void PointUp()
        {
            switch (_state)
            {
            case CaptureState.SelectingWindow:
                break;

            case CaptureState.SelectedWindow:
                break;

            case CaptureState.SelectingCaptureArea:
                stopDrawing();
                DiscWindows.Get().ShowOwnWindows();
                Close();
                break;

            default:
                throw new NotSupportedException();
            }
        }
Beispiel #14
0
        private void ValidateButtons(SessionInfo session)
        {
            if (session.discussion != null)
            {
                btnResults.LaunchDel        = StartResultViewer;
                btnDiscussionInfo.LaunchDel = ShowDiscussionInfo;
                btnPrivate.LaunchDel        = startPrivateBoard;
                btnPublic.LaunchDel         = startPublicBoard;
            }
            else
            {
                btnResults.LaunchDel        = null;
                btnPrivate.LaunchDel        = null;
                btnPublic.LaunchDel         = null;
                btnDiscussionInfo.LaunchDel = null;
                DiscWindows.Get().CloseUserDashboards();
            }

            if (session.IsModerator)
            {
                btnSeatManager.LaunchDel    = startSeatMgr;
                btnModeratorBoard.LaunchDel = startDashboard;
                btnUserManager.LaunchDel    = startUserManager;
                btnSessionManager.LaunchDel = startSessionMgr;
                btnSessionViewer.LaunchDel  = startSessionViewer;
                btnReporter.LaunchDel       = startReporter;
                btnMeg.LaunchDel            = startMeg;
            }
            else
            {
                btnSeatManager.LaunchDel    = null;
                btnModeratorBoard.LaunchDel = null;
                btnUserManager.LaunchDel    = null;
                btnSessionManager.LaunchDel = null;
                btnSessionViewer.LaunchDel  = null;
                btnReporter.LaunchDel       = null;
                btnMeg.LaunchDel            = null;
            }

            btnLogOut.LaunchDel = startLogOut;
        }
        public void Deinit()
        {
            _mediator.PdfOpen       = false;
            _mediator.LasersEnabled = false;
            SetListeners(false);

            DiscWindows.Get().ShowPublic();

            if (_viewStateTimer != null)
            {
                _viewStateTimer.Stop();
                _viewStateTimer.Tick -= _viewStateTimer_Tick;
                _viewStateTimer       = null;
            }

            _recentSyncedScrollX = 0;
            _recentSyncedScrollY = 0;
            _recentSyncedZoom    = 0;

            ExplanationModeMediator.Inst.OnWndClosed(this);
            Hide();
        }
Beispiel #16
0
 private void btnHome_Click_1(object sender, RoutedEventArgs e)
 {
     DiscWindows.Get().mainWnd.Activate();
     //this.Close();
 }
        void Init(string url, int?topicId)
        {
            _url = url;

            ExplanationModeMediator.Inst.WebkitOpen = true;

            //if (ExplanationModeMediator.Inst.ExplanationModeEnabled)
            //{
            //    WindowState = WindowState.Maximized;
            //}
            //else
            {
                WindowState = WindowState.Normal;
                Width       = 1280;
                Height      = 768;
            }

            //
            // _webKitBrowser1
            //
            if (_webKitBrowser1 == null)
            {
                _webKitBrowser1 = new WebKit.WebKitBrowser
                {
                    BackColor = System.Drawing.Color.White,
                    Location  = new System.Drawing.Point(0, 0),
                    Margin    = new System.Windows.Forms.Padding(0),
                    Name      = "_webKitBrowser1",
                    TabIndex  = 0
                };
                _webKitBrowser1.Navigated += _webKitBrowser1_Navigated;
                webkitHost.Child           = _webKitBrowser1;
                _webKitBrowser1.ResumeLayout();
            }

            browserBar.Browser = _webKitBrowser1;
            browserBar.Window  = this;

            browserBar.addressBar.Text = _url;
            _webKitBrowser1.Navigate(_url);
            // _webKitBrowser1.Navigate(@"file:///C:\Users\User\Documents\Visual Studio 2013\Projects\tds3\discussions\bin\x86\Debug\qwe.html");
            //string str = Reencoder.GetUrlContent("http://www.shinmai.co.jp/olympic/jouhou/shochi.htm");
            //var reencoded = Reencoder.ShiftJisToUtf8(str);
            //_webKitBrowser1.Document.CreateTextNode(reencoded);// aTextContent = reencoded;

            if (ExplanationModeMediator.Inst.ExplanationModeEnabled)
            {
                DiscWindows.Get().HidePublic();
            }

            ResizeMode = ResizeMode.NoResize;

            //if (_inst != null)
            //    EnsureInstanceDeinited(); //close previous instance
            _inst = this;

            _mediator = ExplanationModeMediator.Inst;

            if (topicId != null)
            {
                _mediator.CurrentTopicId = topicId;
            }

            if (_mediator.ExplanationModeEnabled)
            {
                RequestScrollPosition();
            }

            if (_scrollStateChecker == null)
            {
                _scrollStateChecker = new DispatcherTimer(DispatcherPriority.Background)
                {
                    Interval = new TimeSpan(200)
                };
            }
            _scrollStateChecker.Tick += _scrollStateChecker_Tick;
            _scrollStateChecker.Start();

            if (_overlayWnd == null)
            {
                _overlayWnd = new BrowserOverlayWindow {
                    Window = this
                }
            }
            ;
            _overlayWnd.Show();

            SetListeners(true);
        }

        void _webKitBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            _webKitBrowser1.Visible = true;
        }
 private void btnCancel_Click_1(object sender, RoutedEventArgs e)
 {
     DiscWindows.Get().ShowOwnWindows();
     Close();
 }