private HistoryItemViewModel Pop()
        {
            HistoryItemViewModel hc = HistoryItems[0];

            HistoryItems.Remove(hc);
            return(hc);
        }
Exemple #2
0
 private WindowHistoryControlViewModel Pop()
 {
     if (HistoryItems.Count > 0)
     {
         WindowHistoryControlViewModel hc = HistoryItems[0];
         HistoryItems.Remove(hc);
         return(hc);
     }
     return(null);
 }
Exemple #3
0
 private void AddHistoryEntry(string content, string expression)
 {
     if (HistoryItems.Count > 0)
     {
         // check to see if the content has changed
         var lastEntry = HistoryItems[0];
         if (lastEntry.ResourceContent == content && lastEntry.Expression == expression)
         {
             return; // (no need to add a new entry)
         }
     }
     HistoryItems.Insert(0, new HistoryItemDetails(content, expression));
     // trim the history to only 100 items
     while (HistoryItems.Count > 100)
     {
         HistoryItems.Remove(HistoryItems.Last());
     }
 }
Exemple #4
0
 private void UserReopenNotepad(WindowHistoryControlViewModel hc)
 {
     HistoryItems.Remove(hc);
     OpenWindowCallback?.Invoke(hc.Notepad);
 }
 private void ReopenAndRemoveFile(HistoryItemViewModel history)
 {
     HistoryItems.Remove(history);
     OpenFileCallback?.Invoke(history.TextDocument);
 }