public void init() { var lst = MainModel.ins.configModel.lstLastProject; string rootPath = SysConst.rootPath(); for (int i = 0; i < lst.Count; ++i) { lst[i].path = MainCtl.formatPath(lst[i].path); } lst.Sort((a, b) => b.lastOpenTime.CompareTo(a.lastOpenTime)); lstVM.Clear(); for (int i = 0; i < lst.Count; ++i) { LastProjectVM vm = new LastProjectVM(lst[i]); lstVM.Add(vm); } if (lstVM.Count > 0) { lstVM.Last().IsLast = true; } }
public void create(string path, PrjoectType type) { var lst = MainModel.ins.configModel.lstLastProject; LastProject md = new LastProject() { name = Path.GetFileNameWithoutExtension(path), path = MainCtl.formatPath(path), type = type, lastOpenTime = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss") }; LastProjectVM vm = new LastProjectVM(md); lst.Add(md); lstVM.Add(vm); }