public void AddRecentFile(string FileName)
 {
     if (string.IsNullOrWhiteSpace(FileName))
     {
         return;
     }
     while (Recent.Contains(FileName))
     {
         Recent.Remove(FileName);
     }
     Recent = Recent.Take(9).ToList();
     Recent.Insert(0, FileName);
 }
예제 #2
0
        public static void SelectLogFile(string fileName)
        {
            Program.LogFileName = fileName;

            ReloadRecent();

            Recent.RemoveAll(r => string.Equals(r, fileName, StringComparison.InvariantCultureIgnoreCase));

            Recent.Insert(0, fileName);

            if (Recent.Count > 20)
            {
                Recent.RemoveAt(20);
            }

            Properties.Settings.Default.Filename = Program.LogFileName;
            Properties.Settings.Default.Recent   = Recent.ToArray();
            Properties.Settings.Default.Save();
        }