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; }
void NextPage() { _currentIterator = null; EnsureSaved(); if (_currentPage < Book.Pages.Count && Book.Pages[_currentPage].Text != "") { ++_currentPage; UpdateTextBox(); UpdateViewLabels(); } }
void PreviousPage() { _currentIterator = null; if (_currentPage > 0) { EnsureSaved(); --_currentPage; UpdateTextBox(); UpdateViewLabels(); } }
public void JumpToPage(int pageIndex) { if (pageIndex < 0 || pageIndex >= Book.Pages.Count) { return; } EnsureSaved(); _currentIterator = null; _currentPage = pageIndex; UpdateTextBox(); UpdateTitle(); UpdateViewLabels(); }
void PreviousVersion() { EnsureSaved(); if (_currentPage >= Book.Pages.Count) { return; } if (_currentIterator == null) { _currentIterator = Book.Pages[_currentPage].GetIterator(); _currentIterator.MoveToEnd(); } if (_currentIterator.MovePrevious()) { UpdateTextBox(); UpdateViewLabels(); } }