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()); } }