Ejemplo n.º 1
0
        private void CreateRecentDocument()
        {
            var recentFileList = RecentFileList.ReadFromFile();

            recentFileList.Reverse();
            RecentFilesPannel.Controls.Clear();

            var countInX   = RecentFilesPannel.DisplayRectangle.Width / 210;
            var countInY   = RecentFilesPannel.DisplayRectangle.Height / 180;
            var totalCount = countInX * countInY;

            foreach (var item in recentFileList.Take(totalCount))
            {
                var button = CreateOpenRecentFileButton(item);
                RecentFilesPannel.Controls.Add(button);
            }
        }
Ejemplo n.º 2
0
        private void AddRecentFile(string filename, DiagramNet.Designer designer)
        {
            var recentFileList = RecentFileList.ReadFromFile();

            recentFileList.RemoveAll(f => f.FilePath.ToLower() == filename.ToLower());
            recentFileList.Add(new RecentFile
            {
                FilePath  = filename,
                Thumbnail = designer.GetThumbnail(),
                DateAdded = DateTime.Now
            });
            while (recentFileList.Count > 15)
            {
                recentFileList.RemoveAt(0);
            }
            recentFileList.SaveToFile();
        }