Beispiel #1
0
        public void AddRecentOpenedFile(RecentOpenedFile recentOpenedFile)
        {
            if (this.RecentOpenedFiles == null)
            {
                this.RecentOpenedFiles = new List <RecentOpenedFile>();
            }

            //remove duplicates
            var previousRecentFile = RecentOpenedFiles.FirstOrDefault(s => s.FullPath.ToLower() == recentOpenedFile.FullPath.ToLower());

            if (previousRecentFile != null)
            {
                RecentOpenedFiles.Remove(previousRecentFile);
            }

            if (this.RecentOpenedFiles.Count > 9)
            {
                this.RecentOpenedFiles.Remove(this.RecentOpenedFiles.OrderBy(x => x.AccessedDateTime).First());
            }

            this.RecentOpenedFiles.Add(recentOpenedFile);
        }
Beispiel #2
0
 public RecentOpenFileControl(RecentOpenedFile recentOpenedFile)
 {
     RecentOpenedFile = recentOpenedFile;
     InitializeComponent();
     InitControl();
 }