Double-click homework in profile launches it

This commit is contained in:
Tim Young 2017-08-08 19:01:42 -05:00
parent fc39ba71c6
commit 405d45e164
1 changed files with 6 additions and 2 deletions

View File

@ -143,6 +143,8 @@ namespace EduNetworkBuilder
tbFullName.LostFocus += SaveUserInfoFromForm;
tbStudentFullName.LostFocus += SaveStudentDataFromForm;
tvClasswork.DoubleClick += btnLaunch_Click;
}
private void DtpHWDue_LostFocus(object sender, EventArgs e)
@ -293,7 +295,7 @@ namespace EduNetworkBuilder
foreach (SchoolworkClass SWC in CurrentUser.Projects)
{
Node = new TreeNode(SWC.Name);
Node.Tag = SWC; //Store the schoolwork record in with the node
Node.Tag = SWC; //Store the schoolwork record in with the node
Top.Nodes.Add(Node);
}
@ -586,7 +588,9 @@ namespace EduNetworkBuilder
private void btnLaunch_Click(object sender, EventArgs e)
{
BuilderWindow BW = NB.GetBuilderWin();
if(BW != null && ViewedSchoolwork != null && ViewedSchoolwork.theProject != null)
if (tvClasswork.SelectedNode != null && tvClasswork.SelectedNode.Tag is string) return;
if (tvClasswork.SelectedNode != null && tvClasswork.SelectedNode.Tag is PersonClass) return;
if (BW != null && ViewedSchoolwork != null && ViewedSchoolwork.theProject != null)
{
ViewedSchoolwork.theProject.WhatFrom = ViewedSchoolwork; //Store the homework info. Used for pushing it back
BW.LoadNetworkFromNetwork(ViewedSchoolwork.theProject);