public ProjectExplorerViewModel(IProjectExplorerItemViewModelFactory projectExplorerItemViewModelFactory, IProjectService projectService)
        {
            _projectExplorerItemViewModelFactory = projectExplorerItemViewModelFactory;
            _projectService = projectService;

            _projectService.CurrentProjectChanged += OnCurrentProjectChanged;
        }
示例#2
0
        public ProjectRootViewModel(IProject project, IProjectExplorerItemViewModelFactory factory,
                                    IAddContextMenuItemFactory addContextMenuItemFactory) : base(project.ProjectName)
        {
            _project = project;
            _factory = factory;

            UpdateItems(_factory.Create(project.Folders, project.Files));

            ContextMenuItems.Add(addContextMenuItemFactory.Create(_project));

            project.FolderAdded += OnProjectItemsChanged;
            project.FileAdded   += OnProjectItemsChanged;
        }
示例#3
0
        public FolderViewModel(IProjectFolder folder, IProjectExplorerItemViewModelFactory factory,
                               IAddContextMenuItemFactory addContextMenuItemFactory) : base(folder.FolderName)
        {
            _folder  = folder;
            _factory = factory;

            UpdateItems(_factory.Create(_folder.Folders, _folder.Files));

            ContextMenuItems.Add(addContextMenuItemFactory.Create(folder));

            folder.FolderAdded += OnFolderItemsChanged;
            folder.FileAdded   += OnFolderItemsChanged;
        }
 public void SetUp()
 {
     _projectExplorerItemViewModelFactory = Substitute.For <IProjectExplorerItemViewModelFactory>();
     _projectService            = Substitute.For <IProjectService>();
     _addContextMenuItemFactory = Substitute.For <IAddContextMenuItemFactory>();
 }