private void _mergePlanListView_SelectedIndexChanged(object sender, EventArgs e) { _currentSelectedMergePro = null;//reset //show detail for this project //load solution detail if (_mergePlanListView.SelectedItems.Count == 0) { return; } //only 1 ListViewItem selectedItem = _mergePlanListView.SelectedItems[0]; var project = selectedItem.Tag as SolutionProject; if (project == null) { return; } _currentSelectedMergePro = project; //load project detail List <ProjectAsmReference> asmRefs = _solutionMx.GetReferenceAsmList(project.RelativePath); _asmRefListView.Items.Clear(); int j = asmRefs.Count; for (int i = 0; i < j; ++i) { _asmRefListView.Items.Add(asmRefs[i]); } }
MergeProject CreateMergeProjectPlan(SolutionProject project) { MergeProject mergePro = new MergeProject(); List <ProjectAsmReference> asmRefs = _solutionMx.GetReferenceAsmList(project.RelativePath); mergePro.PostMergeRefs = _solutionMx.GetPostMergeReferences(project.RelativePath); // string fullProjectDir = System.IO.Path.GetDirectoryName(_solutionMx.SolutionDir + "\\" + project.RelativePath); string projFilename = System.IO.Path.GetFileName(project.RelativePath); int j = asmRefs.Count; for (int i = 0; i < j; ++i) { ProjectAsmReference asmRef = asmRefs[i]; switch (asmRef.Kind) { case ProjectAsmReferenceKind.ProjectReference: string result = System.IO.Path.Combine(fullProjectDir, asmRef.Name); if (!System.IO.File.Exists(result)) { } mergePro.LoadSubProject(result); break; case ProjectAsmReferenceKind.Reference: mergePro._asmReferences.Add(asmRef.Name); break; } } //---------- //find var pro = GlobalLoadedProject.LoadProject(fullProjectDir + "\\" + projFilename); foreach (var item in pro.AllEvaluatedProperties) { //select some our interest features switch (item.Name) { case "DefineConstants": mergePro.DefineConstants = item.EvaluatedValue; break; case "TargetFrameworkVersion": mergePro.TargetFrameworkVersion = item.EvaluatedValue; break; } } return(mergePro); }