Ejemplo n.º 1
0
        /// <summary>
        ///     Load the recent items list
        /// </summary>
        private void LoadRecent()
        {
            var list = new List <FileLogItem>(Program.Account.RecentList);

            // Update the Recent List
            fRecentList.Controls.Clear();
            list.ForEach(f =>
            {
                var fullPath = Path.GetFullPath(Path.Combine(Program.Account.Paths.Local, f.CommonPath));
                var t        = new trayFormListItem
                {
                    FileNameLabel   = Common._name(f.CommonPath),
                    FileStatusLabel = Common.Languages[UiControl.Modified] + " " + f.LatestChangeTime().FormatDate()
                };
                // Open the file in explorer.exe on click
                t.Click += (sender, args) => Process.Start("explorer.exe", @"/select, " + fullPath);
                fRecentList.Controls.Add(t);
            });
            if (list.Count == 0)
            {
                // If recent list is empty, just add a single 'Not Available' item
                fRecentList.Controls.Add(new trayFormListItem
                {
                    FileNameLabel   = Common.Languages[MessageType.NotAvailable],
                    FileStatusLabel = string.Empty
                });
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Load the recent items list
 /// </summary>
 private void LoadRecent()
 {
     var list = new List<FileLogItem>(Program.Account.RecentList);
     // Update the Recent List
     fRecentList.Controls.Clear();
     list.ForEach(f =>
     {
         var fullPath = Path.GetFullPath(Path.Combine(Program.Account.Paths.Local, f.CommonPath));
         var t = new trayFormListItem
         {
             FileNameLabel = Common._name(f.CommonPath),
             FileStatusLabel = Common.Languages[UiControl.Modified] + " " + f.LatestChangeTime().FormatDate()
         };
         // Open the file in explorer.exe on click
         t.Click += (sender, args) => Process.Start("explorer.exe", @"/select, " + fullPath);
         fRecentList.Controls.Add(t);
     });
     if (list.Count == 0)
     {
         // If recent list is empty, just add a single 'Not Available' item
         fRecentList.Controls.Add(new trayFormListItem
         {
             FileNameLabel = Common.Languages[MessageType.NotAvailable],
             FileStatusLabel = string.Empty
         });
     }
 }