Пример #1
0
 public RecentFiles()
 {
     for (int i = 1; i <= 5; i++)
     {
         RecentFileItem r = new RecentFileItem();
         r.Add("Not available", null, null, DateTime.MinValue);
         RecentList.Add(r);
     }
 }
Пример #2
0
 /// <summary>
 /// Add a new file to the recent-list
 /// </summary>
 /// <param name="n">file's name</param>
 /// <param name="l">file's http link</param>
 /// <param name="p">file's local path</param>
 /// <param name="d">file's LastWriteTime</param>
 public void Add(string n, string l, string p, DateTime d)
 {
     RecentFileItem r = new RecentFileItem();
     r.Add(n, l, p, d);
     Log.Write(FTPbox.l.Debug, "Contains: {0}", Contains(n));
     if (Contains(n))
     {
         foreach (RecentFileItem f in RecentList)
             if (f.Name == n)
             {
                 int ind = RecentList.IndexOf(f);
                 RecentList[ind].LastWriteTime = d;
                 RecentList[ind].Link = l;
                 RecentList[ind].Path = p;
             }
     }
     else
         RecentList.Add(r);
 }