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

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)
@ -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);