private void AddSequenceToRecentList(string filename)
{
// remove the item from the list if it exists, then insert it in the front
foreach (string filepath in _applicationData.RecentSequences.ToArray()) {
if (filepath == filename) {
_applicationData.RecentSequences.Remove(filepath);
}
}
_applicationData.RecentSequences.Insert(0, filename);
if (_applicationData.RecentSequences.Count > _maxRecentSequences)
_applicationData.RecentSequences.RemoveRange(_maxRecentSequences,
_applicationData.RecentSequences.Count - _maxRecentSequences);
_applicationData.SaveData();
PopulateRecentSequencesList();
}