/// <summary> /// 双击listview中的item /// </summary> private void listView_MouseDoubleClick(object sender, MouseEventArgs e) { ListViewHitTestInfo info = listView.HitTest(e.X, e.Y); if (info.Item != null) { ListViewItem item = info.Item; if (item.ImageIndex == 0) //如果是文件夹 { if (item.SubItems[4].Text.StartsWith("group:\\")) { //分类展示 string childpath = folderController.GoChildPath(item.SubItems[4].Text.Replace(folderController.GetFullPath() + "\\", "")); LabelPath.Text = childpath; listViewController.Show(childpath, mHideSeen); } else if (item.SubItems[4].Text.StartsWith("project:\\")) { //打开项目 FormCodeView formCV = new FormCodeView(this); formCV.LoadHmwk(listViewController.stuDict[item.SubItems[1].Text][item.SubItems[2].Text]); formCV.OpenFolder(item.SubItems[4].Text.Replace("project:\\", "")); formCV.Show(this); } else { //仅仅打开目录 string childpath = folderController.GoChildPath(item.Text); LabelPath.Text = childpath; listViewController.Import(childpath); } } else //如果是文件 { FormCodeView formCV = new FormCodeView(this); formCV.OpenFolder(folderController.GetFullPath()); formCV.OpenFile(item.Text); formCV.Show(this); } this.btnFolderBack.Enabled = folderController.IsRoot() ? false : true; } }
public FormScore(FormCodeView formCV) { mFormCodeView = formCV; InitializeComponent(); }