Beispiel #1
0
        public static ReaderWindow Instance(string pdfPathName, int attachmentId, int? topicId, bool localRequest)
        {
            if (_inst == null)
                _inst = new ReaderWindow();

            _inst.Init(pdfPathName, attachmentId, topicId, localRequest);

            return _inst;
        }
Beispiel #2
0
        public static ReaderWindow Instance(string pdfPathName, int attachmentId, int?topicId, bool localRequest)
        {
            if (_inst == null)
            {
                _inst = new ReaderWindow();
            }

            _inst.Init(pdfPathName, attachmentId, topicId, localRequest);

            return(_inst);
        }
Beispiel #3
0
        public static void EnsureInstanceClosed()
        {
            if (_inst == null)
                return; //already closed

            try
            {
                _inst.Close();
            }
            catch
            {
            }

            _inst = null;
        }
Beispiel #4
0
        public static void EnsureInstanceClosed()
        {
            if (_inst == null)
            {
                return; //already closed
            }
            try
            {
                _inst.Close();
            }
            catch
            {
            }

            _inst = null;
        }
Beispiel #5
0
        void Init(string pdfPathName, int attachmentId, int?topicId, bool localRequest)
        {
            _inst = this;

            DataContext = this;

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

            this.WindowState = WindowState.Normal;

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

            pdfViewerUC.PdfPathName = pdfPathName;

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

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

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

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

            SetListeners(true);

            //if (_overlayWnd==null)
            //    _overlayWnd = new ReaderOverlayWindow { Window = this };
            //_overlayWnd.Show();
        }
Beispiel #6
0
        void Init(string pdfPathName, int attachmentId, int? topicId, bool localRequest)
        {
            _inst = this;

            DataContext = this;

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

            this.WindowState = WindowState.Normal;

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

            pdfViewerUC.PdfPathName = pdfPathName;

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

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

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

            if (_mediator.ExplanationModeEnabled)
                RequestScrollPosition();

            SetListeners(true);

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