private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { if (listBox1.SelectedItem == null) { return; } string solutionpath = listBox1.SelectedItem.ToString(); if (!System.IO.File.Exists(solutionpath)) { MessageBox.Show("该项目已经移动,或不存在了。"); PathCenter.DelSolution(solutionpath); return; } if (dte.Solution.FullName == "") { dte.Solution.Open(solutionpath); } else { System.Diagnostics.Process p = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo ps = new System.Diagnostics.ProcessStartInfo(solutionpath); p.StartInfo = ps; p.Start(); } }
// 载入默认项目 private void ProjectView_Load(object sender, EventArgs e) { var us = from u in JianLi3Data.JianLiLinq.Default.DB.User2s where u.Name == "epicblue" select u; user = us.Single(); // powerbox-14qm8h var ps = from p in JianLi3Data.JianLiLinq.Default.DB.Projects from pu in p.ProjectUsers where pu.User2 == user select pu.Project1; foreach (JianLi3Data.Project p in ps) { this.toolStripComboBox1.Items.Add(p.Name); } if (user.DefaultProject.HasValue) { LoadProject(user.Project); toolStripComboBox1.Text = user.Project.Name; } else { JianLi3Data.Project p = PathCenter.CreateProject(); if (p != null) { LoadProject(p); // 用户关联默认项目 user.Project = p; // 项目关联用户 JianLi3Data.ProjectUser pu = new JianLi3Data.ProjectUser(); pu.Project1 = p; pu.User2 = user; JianLi3Data.JianLiLinq.Default.DB.ProjectUsers.InsertOnSubmit(pu); JianLi3Data.JianLiLinq.Default.DB.SubmitChanges(); } } }
private void 子模块ToolStripMenuItem_Click(object sender, EventArgs e) { if (!(this.ProjectTreeView.SelectedNode.Tag is ProjectModule)) { return; } ProjectModule pm = (ProjectModule)this.ProjectTreeView.SelectedNode.Tag; ProjectModule npm = PathCenter.CreateModule(pm); if (npm == null) { return; } TreeNode tn = new TreeNode(); tn.Text = npm.Name; tn.Tag = npm; tn.ForeColor = Color.Blue; this.ProjectTreeView.SelectedNode.Nodes.Add(tn); }
private void 子任务ToolStripMenuItem_Click(object sender, EventArgs e) { TreeNode tn = ProjectTreeView.SelectedNode; if (!(tn.Tag is ProjectModule)) { return; } ProjectModule module = (ProjectModule)tn.Tag; Task t = PathCenter.CreateTask(module, project); if (t == null) { return; } TreeNode ntn = new TreeNode(); ntn.Text = t.Title; ntn.Tag = t; tn.Nodes.Add(ntn); }
private void button2_Click(object sender, EventArgs e) { JianLi3Data.Project p = PathCenter.CreateProject(); TryLoadProject(p); }