Ejemplo n.º 1
0
        public async Task <ProjectViewModel> OpenProject(RecentProject t)
        {
            var project = await ProjectViewModel.Get(t.Id);

            await AddToRecentList(project);

            OnProjectOpened(project);
            return(project);
        }
Ejemplo n.º 2
0
        internal async Task AddToRecentList(ProjectViewModel project)
        {
            var lst = (from z in RecentProjects
                       where !z.Id.Equals(project.MetaData.Id, StringComparison.InvariantCultureIgnoreCase)
                       select z).ToList();

            lst.Insert(0, RecentProject.From(project, DateTime.Now));
            RecentProjects = lst;
            OnPropertyChanged("RecentProjects");
            var json = JsonConvert.SerializeObject(lst);
            await _settingsMgr.SetSettings("recent_projects", json, true);
        }
Ejemplo n.º 3
0
        internal static RecentProject From(ProjectViewModel project, DateTime lastChange)
        {
            var t = new RecentProject()
            {
                Id         = project.MetaData.Id,
                LastChange = lastChange,
                Kind       = "",
                Name       = project.MetaData.Name,
                LastPath   = project.MetaData.LastPath
            };

            return(t);
        }