|
#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using SmartInstitute.ObjectModel;
using System.Windows.Forms;
using SmartInstitute.Client.Automation.Views;
using SmartInstitute;
#endregion
namespace SmartInstitute.Client.Automation.Documents.StudentDocuments
{
/// <summary>
/// Shows details about the student model
/// </summary>
public class StudentDocument : DocumentBase
{
private GenericCollection<DocumentBase> _ChildViews;
public GenericCollection<DocumentBase> ChildViews
{
get { return _ChildViews; }
set { _ChildViews = value; }
}
public StudentDocument( StudentModel model, StudentDocumentUI ui, bool showRegistrationView, object parent )
: base( model.StudentID, model.FullName, ui, parent )
{
this._StudentModel = model;
this._ShowRegistrationView = showRegistrationView;
}
private StudentModel _StudentModel;
public StudentModel StudentModel
{
get { return _StudentModel; }
set { _StudentModel = value; }
}
private bool _ShowRegistrationView;
public bool ShowRegistrationView
{
get { return _ShowRegistrationView; }
set { _ShowRegistrationView = value; }
}
public override bool IsFeatureSupported(object feature)
{
throw new NotImplementedException();
}
public override bool CanAccept(object data)
{
if (data is CourseSection)
return true;
else
return false;
}
public override bool Accept(object data)
{
if (data is Course)
{
if (null == OnAddCourse)
return false;
else
return OnAddCourse(data as Course);
}
else if (data is CourseSection)
{
if (null == OnAddSection)
return false;
else
return OnAddSection(data as CourseSection);
}
else
{
return false;
}
}
/// <summary>
/// Delegate used when a course is sent to the student view
/// </summary>
/// <param name="course"></param>
public delegate bool AddCourseHandler(Course course);
public event AddCourseHandler OnAddCourse;
public delegate bool AddSectionHandler(CourseSection section);
public event AddSectionHandler OnAddSection;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here