Пример #1
0
        /// <summary>
        /// Opens the last closed file via callbacks
        /// </summary>
        public void ReopenLastNotepad()
        {
            WindowHistoryControlViewModel hc = Pop();

            if (hc != null)
            {
                ReopenNotepad(hc);
            }
        }
Пример #2
0
 private WindowHistoryControlViewModel Pop()
 {
     if (HistoryItems.Count > 0)
     {
         WindowHistoryControlViewModel hc = HistoryItems[0];
         HistoryItems.Remove(hc);
         return(hc);
     }
     return(null);
 }
Пример #3
0
        /// <summary>
        /// Pushes a Notepad View's DataContext (that has just closed) to the history
        /// </summary>
        /// <param name="path"></param>
        public void PushNotepad(NotepadViewModel notepad)
        {
            WindowHistoryControlViewModel item = CreateHistoryItem(notepad);

            Push(item);
        }
Пример #4
0
 private void Push(WindowHistoryControlViewModel hc)
 {
     HistoryItems.Insert(0, hc);
 }