Bloom.Edit.PageSelection.SelectPage C# (CSharp) Method

SelectPage() public method

public SelectPage ( IPage page ) : bool
page IPage
return bool
        public bool SelectPage(IPage page)
        {
            #if __MonoCS__
            // If we haven't finished displaying the previously selected page, we can't select another page yet.
            // See https://silbloom.myjetbrains.com/youtrack/issue/BL-3586.
            if (_stillChanging)
                return false;
            #endif
            //enhance... make pre-change event cancellable
            InvokeSelectionChanging();
            _currentSelection = page;

            InvokeSelectionChanged();
            return true;
        }

Usage Example

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

            _currentlyDisplayedBook = CurrentBook;

            var errors = _bookSelection.CurrentSelection.GetErrorsIfNotCheckedBefore();

            if (!string.IsNullOrEmpty(errors))
            {
                Palaso.Reporting.ErrorReport.NotifyUserOfProblem(errors);
                return;
            }
            var page = _bookSelection.CurrentSelection.FirstPage;

            if (page != null)
            {
                _pageSelection.SelectPage(page);
            }

            if (_view != null)
            {
                if (ShowTemplatePanel)
                {
                    _view.UpdateTemplateList();
                }
                _view.UpdatePageList(false);
            }
        }
All Usage Examples Of Bloom.Edit.PageSelection::SelectPage