コード例 #1
0
        public static SolutionItemViewModel Create(ISolutionParentViewModel parent, ISolutionItem item)
        {
            SolutionItemViewModel result = null;

            if (item is ISolutionFolder folder)
            {
                result = new SolutionFolderViewModel(parent, folder);
            }
            else if (item is IProject project)
            {
                result = new StandardProjectViewModel(parent, project);
            }
            else
            {
                throw new Exception("Unrecognised model type");
            }

            return(result);
        }
コード例 #2
0
        public static ProjectViewModel Create(SolutionViewModel solutionViewModel, IProject model)
        {
            ProjectViewModel result = new StandardProjectViewModel(solutionViewModel, model);

            return(result);
        }