Bloom.Edit.EditingModel.ViewVisibleNowDoSlowStuff C# (CSharp) Method

ViewVisibleNowDoSlowStuff() public method

public ViewVisibleNowDoSlowStuff ( ) : void
return void
        public void ViewVisibleNowDoSlowStuff()
        {
            if(_currentlyDisplayedBook != CurrentBook)
            {
                CurrentBook.PrepareForEditing();
            }

            _currentlyDisplayedBook = CurrentBook;

            var errors = _currentlyDisplayedBook.GetErrorsIfNotCheckedBefore();
            if (!string.IsNullOrEmpty(errors))
            {
                ErrorReport.NotifyUserOfProblem(errors);
                return;
            }

            // BL-2339: try to choose the last edited page
            var page = _currentlyDisplayedBook.GetPageByIndex(_currentlyDisplayedBook.UserPrefs.MostRecentPage) ?? _currentlyDisplayedBook.FirstPage;
            try
            {
                _inProcessOfLoading = true;
                if (page != null)
                    _pageSelection.SelectPage(page);

                if (_view != null)
                {
                    _view.UpdatePageList(false);
                }
            }
            finally
            {
                _inProcessOfLoading = false;
            }
        }

Usage Example

コード例 #1
0
        void VisibleNowAddSlowContents(object sender, EventArgs e)
        {
            //TODO: this is causing green boxes when you quit while it is still working
            //we should change this to a proper background task, with good
            //cancellation in case we switch documents.  Note we may also switch
            //to some other way of making the thumbnails... e.g. it would be nice
            //to have instant placeholders, with thumbnails later.

            Application.Idle -= new EventHandler(VisibleNowAddSlowContents);

            CheckFontAvailablility();

            Cursor = Cursors.WaitCursor;
            _model.ViewVisibleNowDoSlowStuff();
            Cursor = Cursors.Default;
        }