private void AddMRUItem(string filename) { if (string.IsNullOrWhiteSpace(filename) || !System.IO.File.Exists(filename)) { return; } List <string> mrulist = this.GetMRUItems(); if (mrulist.Contains(filename)) { mrulist.Remove(filename); } mrulist.Insert(0, filename); if (mrulist.Count >= 10) { for (int i = 10; i < mrulist.Count; i++) { mrulist.RemoveAt(i); } } RegistrySettings.SetValue("MRUList", mrulist); }
private void RemoveMRUItem(string filename) { List <string> mrulist = this.GetMRUItems(); if (mrulist.Contains(filename)) { mrulist.Remove(filename); } RegistrySettings.SetValue("MRUList", mrulist); }
private List <string> GetMRUItems() { List <string> items = new List <string>(); string[] list = RegistrySettings.GetValue("MRUList", null) as string[]; if (list != null) { items.AddRange(list); } return(items); }