Ejemplo n.º 1
0
        private void OnSelectedTabChanged(TabChangedDetails obj)
        {
            if (obj.To is LibraryView)
            {
                Application.Idle -= ManageButtonsAtIdleTime;
                Application.Idle += ManageButtonsAtIdleTime;
                Book.Book book = SelectedBook;
                if (book != null && SelectedButton != null)
                {
                    SelectedButton.Text = ShortenTitleIfNeeded(book.TitleBestForUserDisplay);

                    if (_thumbnailRefreshPending)
                    {
                        _thumbnailRefreshPending = false;
                        ScheduleRefreshOfOneThumbnail(book);
                    }
                }
                if (_primaryCollectionReloadPending)
                {
                    LoadPrimaryCollectionButtons();
                    // One reason to reload is that we created a new book. We need to go through the steps of selecting it
                    // so that e.g. its menu options are properly configured.
                    if (SelectedBook != null)
                    {
                        SelectBook(SelectedBook.BookInfo);
                    }
                }
            }
            else
            {
                Application.Idle -= ManageButtonsAtIdleTime;
            }
        }
Ejemplo n.º 2
0
        private void OnSelectedTabChanged(TabChangedDetails obj)
        {
            if (obj.To is LibraryView)
            {
                Application.Idle -= ManageButtonsAtIdleTime;
                Application.Idle += ManageButtonsAtIdleTime;
                Book.Book book = SelectedBook;
                if (book != null && SelectedButton != null)
                {
                    SelectedButton.Text = ShortenTitleIfNeeded(book.TitleBestForUserDisplay);

                    if (_thumbnailRefreshPending)
                    {
                        _thumbnailRefreshPending = false;
                        ScheduleRefreshOfOneThumbnail(book);
                    }
                }
                if (_primaryCollectionReloadPending)
                {
                    LoadPrimaryCollectionButtons();
                }
            }
            else
            {
                Application.Idle -= ManageButtonsAtIdleTime;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// we need to guarantee that we save *before* any other tabs try to update, hence this "about to change" event
 /// </summary>
 /// <param name="details"></param>
 private void OnTabAboutToChange(TabChangedDetails details)
 {
     if (details.From == _view)
     {
         SaveNow();
         //note: if they didn't actually change anything, Chorus is not going to actually do a checkin, so this
         //won't polute the history
         _sendReceiver.CheckInNow(string.Format("Edited '{0}'", _bookSelection.CurrentSelection.TitleBestForUserDisplay));
     }
 }
Ejemplo n.º 4
0
 private void OnSelectedTabChanged(TabChangedDetails obj)
 {
     if(obj.To is LibraryView)
     {
         Application.Idle -= ManageButtonsAtIdleTime;
         Application.Idle += ManageButtonsAtIdleTime;
         Book.Book book = SelectedBook;
         if (book != null && SelectedButton != null)
         {
             var bestTitle = book.TitleBestForUserDisplay;
             SelectedButton.Text = ShortenTitleIfNeeded(bestTitle, SelectedButton);
             toolTip1.SetToolTip(SelectedButton, bestTitle);
             if (_thumbnailRefreshPending)
             {
                 _thumbnailRefreshPending = false;
                 ScheduleRefreshOfOneThumbnail(book);
             }
         }
         if (_primaryCollectionReloadPending)
         {
             LoadPrimaryCollectionButtons();
             // One reason to reload is that we created a new book. We need to go through the steps of selecting it
             // so that e.g. its menu options are properly configured.
             if (SelectedBook != null)
             {
                 SelectBook(SelectedBook.BookInfo);
                 ScheduleRefreshOfOneThumbnail(book);
             }
         }
     }
     else
     {
         Application.Idle -= ManageButtonsAtIdleTime;
     }
 }
Ejemplo n.º 5
0
 private void OnTabChanged(TabChangedDetails details)
 {
     _previouslySelectedPage = null;
     Visible = details.To == _view;
     _view.OnVisibleChanged(Visible);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// we need to guarantee that we save *before* any other tabs try to update, hence this "about to change" event
        /// </summary>
        /// <param name="details"></param>
        private void OnTabAboutToChange(TabChangedDetails details)
        {
            if (details.From == _view)
            {
                SaveNow();
                //note: if they didn't actually change anything, Chorus is not going to actually do a checkin, so this
                //won't polute the history
                _sendReceiver.CheckInNow(string.Format("Edited '{0}'", _bookSelection.CurrentSelection.TitleBestForUserDisplay));

            }
        }
Ejemplo n.º 7
0
        private void OnSelectedTabChanged(TabChangedDetails obj)
        {
            if(obj.To is LibraryView)
            {
                Application.Idle -= ManageButtonsAtIdleTime;
                Application.Idle += ManageButtonsAtIdleTime;
                Book.Book book = SelectedBook;
                if (book != null && SelectedButton != null)
                {
                    SelectedButton.Text = ShortenTitleIfNeeded(book.TitleBestForUserDisplay);

                    if (_thumbnailRefreshPending)
                    {
                        _thumbnailRefreshPending = false;
                        ScheduleRefreshOfOneThumbnail(book);
                    }
                }
                if (_primaryCollectionReloadPending)
                {
                    LoadPrimaryCollectionButtons();
                }
            }
            else
            {
                Application.Idle -= ManageButtonsAtIdleTime;
            }
        }
Ejemplo n.º 8
0
 private void OnTabChanged(TabChangedDetails details)
 {
     _previouslySelectedPage = null;
     Visible = details.To == _view;
     _view.OnVisibleChanged(Visible);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// we need to guarantee that we save *before* any other tabs try to update, hence this "about to change" event
 /// </summary>
 /// <param name="details"></param>
 private void OnTabAboutToChange(TabChangedDetails details)
 {
     if (details.From == _view)
     {
         SaveNow();
         _view.RunJavaScript("if (typeof(FrameExports) !=='undefined') {FrameExports.getPageFrameExports().disconnectForGarbageCollection();}");
         // This bizarre behavior prevents BL-2313 and related problems.
         // For some reason I cannot discover, switching tabs when focus is in the Browser window
         // causes Bloom to get deactivated, which prevents various controls from working.
         // Moreover, it seems (BL-2329) that if the user types Alt-F4 while whatever-it-is is active,
         // things get into a very bad state indeed. So arrange to re-activate ourselves as soon as the dust settles.
         _oldActiveForm = Form.ActiveForm;
         Application.Idle += ReactivateFormOnIdle;
         //note: if they didn't actually change anything, Chorus is not going to actually do a checkin, so this
         //won't pollute the history
         #if Chorus
             _sendReceiver.CheckInNow(string.Format("Edited '{0}'", CurrentBook.TitleBestForUserDisplay));
         #endif
     }
 }