/// <summary> /// This function displays details of the assignment that is assigned. /// </summary> /// <param name="a_sender">It holds the sender object.</param> /// <param name="a_eventArgs">It holds the event arguments.</param> private void AssignmentList_Click(object a_sender, MouseEventArgs a_eventArgs) { Assignment clickedAssignment = (Assignment)assignmentList.SelectedItems[0].Tag; /// Redirects the functionality to the respective user controller depending on if student or professor is logged in. if (!m_isStudent) { /// Adds the user controller if it has not been done yet. Otherwise, brings the controller to the front. if (m_ucFacAssignment == null) { m_ucFacAssignment = new FacultyAssignmentUC(m_facEmail); m_ucFacAssignment.Dock = DockStyle.Fill; courseDetailPanel.Controls.Add(m_ucFacAssignment); } m_ucFacAssignment.Open(clickedAssignment); m_ucFacAssignment.BringToFront(); } else { /// Adds the user controller if it has not been done yet. Otherwise, brings the controller to the front. if (m_ucStdAssignment == null) { m_ucStdAssignment = new StudentAssignmentUC(m_studentEmail); m_ucStdAssignment.Dock = DockStyle.Fill; courseDetailPanel.Controls.Add(m_ucStdAssignment); } m_ucStdAssignment.Open(clickedAssignment); m_ucStdAssignment.BringToFront(); } }
/// <summary> /// This function is On Click listener for adding the assignment. /// </summary> /// <param name="a_sender">It holds the sender object.</param> /// <param name="a_event">It holds the event arguments.</param> private void metroTile1_Click(object a_sender, EventArgs a_event) { // Checks if user controller exists. If not, then creates a new one then opens a form to create an assignment. if (m_ucFacAssignment == null) { m_ucFacAssignment = new FacultyAssignmentUC(m_facEmail); m_ucFacAssignment.Dock = DockStyle.Fill; courseDetailPanel.Controls.Add(m_ucFacAssignment); } m_ucFacAssignment.MakeNew(m_course, assignmentList.Items.Count + 1); m_ucFacAssignment.BringToFront(); }