Exemple #1
0
        private void PopulateLeftPanel()
        {
            List <string> mruList         = Settings.Default.MruList; // New MRU Length is 20, for file menu is only 4.
            var           distanceFromTop = 0;

            foreach (var mru in mruList)
            {
                string filePath          = mru;
                var    recentFileControl = new RecentFileControl
                {
                    FileName    = Path.GetFileName(filePath),
                    FilePath    = filePath,
                    Width       = recentFilesPanel.Width - 20,
                    Top         = distanceFromTop,
                    EventAction = () => DoAction(skylineWindow => skylineWindow.LoadFile(filePath, this))
                };
                toolTip.SetToolTip(recentFileControl, filePath);
                foreach (Control control in recentFileControl.Controls)
                {
                    toolTip.SetToolTip(control, filePath);
                }
                recentFilesPanel.Controls.Add(recentFileControl);
                distanceFromTop += recentFileControl.Height + 3; // 3 is padding between each RecentFileControl.
            }
        }
Exemple #2
0
 private void PopulateLeftPanel()
 {
     List<string> mruList = Settings.Default.MruList; // New MRU Length is 20, for file menu is only 4.
     var distanceFromTop = 0;
     foreach (var mru in mruList)
     {
         string filePath = mru;
         var recentFileControl = new RecentFileControl
         {
             FileName = Path.GetFileName(filePath),
             FilePath = filePath,
             Width = recentFilesPanel.Width - 20,
             Top = distanceFromTop,
             EventAction = () => DoAction(skylineWindow=>skylineWindow.LoadFile(filePath, this))
         };
         toolTip.SetToolTip(recentFileControl, filePath);
         foreach (Control control in recentFileControl.Controls)
         {
             toolTip.SetToolTip(control, filePath);
         }
         recentFilesPanel.Controls.Add(recentFileControl);
         distanceFromTop += recentFileControl.Height + 3; // 3 is padding between each RecentFileControl.
     }
 }