/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sender">The sending queue for this class</param>
        /// <param name="model">The PresenterModel for the network service</param>
        /// <param name="role">The StudentModel for this network service</param>
        public StudentNetworkService(SendingQueue sender, PresenterModel model, StudentModel role)
            : base(sender, role)
        {
            this.m_Student = role;
            this.m_Model = model;

            // Instanciate the submission status service
            submission_status_service_ = new SubmissionStatusNetworkService(this.Sender, role);

            // Create a delegate that will update the local copy of the current
            // presentation whenever it changes in the workspace.
            //
            // This causes the set{} accessor for CurrentPresentation to be run,
            // which as a side effect disposes of and recreates all the network
            // services associated with the student.
            this.m_PresentationChangedDispatcher =
                this.m_Model.Workspace.CurrentPresentation.ListenAndInitialize(sender,
                    delegate(Property<PresentationModel>.EventArgs args) {
                        if (args.New != null) {
                            this.CurrentPresentation = args.New;
                        }
                    });
        }
예제 #2
0
        protected override bool UpdateTarget(ReceiveContext context)
        {
            StudentModel role = this.Target as StudentModel;
            if(role == null)
                this.Target = role = new StudentModel(((Guid) this.TargetId));

            base.UpdateTarget(context);

            return true;
        }
예제 #3
0
 public StudentMessage(StudentModel role)
     : base(role)
 {
     // Currently StudentModel has no published properties.
 }