コード例 #1
0
        private void _text_TextChanged(object sender, EventArgs e)
        {
            UpdateTitle();
            if (_settingText)
            {
                return;
            }

            if (!_dirty)
            {
                _lastSave = DateTime.UtcNow;
            }
            _lastModification = DateTime.UtcNow;
            if (_text.Text == "")
            {
                EnsureSaved();
            }
            _textContents = _text.Text;
            if (_textContents == "")
            {
                _currentPage = Book.Pages.Count;
                Book.AddPage();
                UpdateViewLabels();
            }
            _currentIterator = null;
            _dirty           = true;
        }
コード例 #2
0
 void NextPage()
 {
     _currentIterator = null;
     EnsureSaved();
     if (_currentPage < Book.Pages.Count && Book.Pages[_currentPage].Text != "")
     {
         ++_currentPage;
         UpdateTextBox();
         UpdateViewLabels();
     }
 }
コード例 #3
0
 void PreviousPage()
 {
     _currentIterator = null;
     if (_currentPage > 0)
     {
         EnsureSaved();
         --_currentPage;
         UpdateTextBox();
         UpdateViewLabels();
     }
 }
コード例 #4
0
 public void JumpToPage(int pageIndex)
 {
     if (pageIndex < 0 || pageIndex >= Book.Pages.Count)
     {
         return;
     }
     EnsureSaved();
     _currentIterator = null;
     _currentPage     = pageIndex;
     UpdateTextBox();
     UpdateTitle();
     UpdateViewLabels();
 }
コード例 #5
0
 void PreviousVersion()
 {
     EnsureSaved();
     if (_currentPage >= Book.Pages.Count)
     {
         return;
     }
     if (_currentIterator == null)
     {
         _currentIterator = Book.Pages[_currentPage].GetIterator();
         _currentIterator.MoveToEnd();
     }
     if (_currentIterator.MovePrevious())
     {
         UpdateTextBox();
         UpdateViewLabels();
     }
 }