예제 #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);
 }