Inheritance: FolderViewModel
Exemplo n.º 1
0
        internal Tuple<int, Project> Add(ProjectViewModel project)
        {
            var pid = _workspace.AddProject(project.Name, "C#");
            var proj = _workspace.CurrentSolution.GetProject(pid);
            int id = Interlocked.Increment(ref _projectsIds);

            if (!_contexts.TryAdd(id, project))
                throw new Exception("Id already taken");

            if (_host.IsConnected)
                _host.InitProject(id, project.Path);

            return new Tuple<int, Project>(id, proj);
        }
Exemplo n.º 2
0
        public static FolderViewModel Get(FolderViewModel parent, DirectoryInfo dir)
        {
            FolderViewModel ret;

            if (dir.Name == "packages" && parent is WorkspaceViewModel)
            {
                ret = new PackagesViewModel(parent, dir, true);
            }

            else if (dir.GetFiles("project.json", SearchOption.TopDirectoryOnly).Length == 1)
            {
                ret = new ProjectViewModel(parent, dir);
            }

            else
            {
                ret = new FolderViewModel(parent, dir);
            }

            ret.Initialize();
            return(ret);
        }
Exemplo n.º 3
0
 public ReferencesViewModel(ProjectViewModel project)
     : base(project)
 {
 }
Exemplo n.º 4
0
        public static FolderViewModel Get(FolderViewModel parent, DirectoryInfo dir)
        {
            FolderViewModel ret;
            if (dir.Name == "packages" && parent is WorkspaceViewModel)
                ret = new PackagesViewModel(parent, dir, true);

            else if (dir.GetFiles("project.json", SearchOption.TopDirectoryOnly).Length == 1)
                ret = new ProjectViewModel(parent, dir);

            else
                ret = new FolderViewModel(parent, dir);

            ret.Initialize();
            return ret;
        }
Exemplo n.º 5
0
 public ReferencesViewModel(ProjectViewModel project)
     : base(project)
 {
 }