public void RemoveFromRecentList(RecentPlan recentPlan)
        {
            int existingIndex = recentPlansList.FindIndex(x => x.Path.Equals(recentPlan.Path, StringComparison.OrdinalIgnoreCase));

            if (existingIndex >= 0)
            {
                recentPlansList.RemoveAt(existingIndex);
                SaveFile();
            }
        }
Exemple #2
0
 private void RecentPlanSelected(RecentPlan recentPlan)
 {
     if (File.Exists(recentPlan.Path))
     {
         LoadPlan(recentPlan.Path, recentPlan.Type);
     }
     else
     {
         recentPlansManager.RemoveFromRecentList(recentPlan);
         ViewManager.ShowMessageBox("$Error", "$Planner.Menu.RecentPlans.FileDoesNotExist");
     }
 }
        public void AddToRecentList(RecentPlan recentPlan)
        {
            int existingIndex = recentPlansList.FindIndex(x => x.Path.Equals(recentPlan.Path, StringComparison.OrdinalIgnoreCase));

            if (existingIndex >= 0)
            {
                recentPlansList.RemoveAt(existingIndex);
            }
            recentPlansList.Insert(0, recentPlan);
            recentPlansList.TrimExcess();

            SaveFile();
        }