Пример #1
0
        private void InitialiseFolders()
        {
            Folders.Clear();
            var r = _folderSpecRepo.Folders;

            Folders.AddRange(r.Select(x => new FolderSpecViewModel(x, _folderSpecRepo)));
            SelectedFolder = Folders.FirstOrDefault();
        }
Пример #2
0
 public void RemoveFolder()
 {
     if (SelectedFolder == null)
     {
         return;
     }
     _folderSpecRepo.Delete(SelectedFolder.Instance);
     Folders.Remove(SelectedFolder);
     SelectedFolder = Folders.FirstOrDefault();
 }
Пример #3
0
        public void AddFolder()
        {
            var s      = new VistaFolderBrowserDialog();
            var result = s.ShowDialog();

            if (result.HasValue == false || result.Value == false || string.IsNullOrEmpty(s.SelectedPath))
            {
                return;
            }

            var newFolderSpec = new FolderSpec(s.SelectedPath);

            _folderSpecRepo.Save(newFolderSpec);
            var newVm = new FolderSpecViewModel(newFolderSpec, _folderSpecRepo);

            Folders.Add(newVm);
            SelectedFolder = newVm;
        }