コード例 #1
0
        /// <summary>
        /// Send a QuickPollResultInformationMessage to the appropriate receivers
        /// </summary>
        /// <param name="receivers">The group of people that should receive the update</param>
        private void SendResultChanged(Group receivers)
        {
            Message message, poll, res;

            message       = new PresentationInformationMessage(this.m_Presentation);
            message.Group = receivers;
            poll          = new QuickPollInformationMessage(this.m_QuickPoll);
            poll.Group    = receivers;
            message.InsertChild(poll);
            res       = new QuickPollResultInformationMessage(this.m_Result);
            res.Group = receivers;
            poll.InsertChild(res);
            this.m_Sender.Send(message);
        }
コード例 #2
0
        /// <summary>
        /// When there is a vote we get this with parents: QuickPollInformationMessage, Presentation..
        /// Contains a owner ID and a result string such as "C" or "Yes".
        /// Presumably the owner ID is the id of the client, so this is how we would know if a client changed his vote.
        /// </summary>
        /// <param name="quickPollResultInformationMessage"></param>
        /// <returns></returns>
        internal object AddQuickResultInformation(UW.ClassroomPresenter.Network.Messages.Presentation.QuickPollResultInformationMessage qprim)
        {
            if (qprim.Parent is CP3Msgs.QuickPollInformationMessage)
            {
                CP3Msgs.QuickPollInformationMessage qpim  = (CP3Msgs.QuickPollInformationMessage)qprim.Parent;
                TableOfContents.TocEntry            qptoc = toc.LookupByQuickPollId((Guid)qpim.TargetId);
                if (qptoc == null)
                {
                    Debug.WriteLine("***QuickPoll Result received for unknown QuickPoll!!");
                    return(null);
                }

                int[] currentvotes = m_QuickPollAggregator.AcceptResult(qprim.Result, (Guid)qpim.TargetId);

                ArchiveRTNav.RTQuickPoll rtqp = new ArchiveRTNav.RTQuickPoll((ArchiveRTNav.QuickPollStyle)qpim.Model.PollStyle, currentvotes, qptoc.DeckId, qptoc.SlideIndex);
                return(rtqp);
            }
            else
            {
                Debug.WriteLine("****Unexpected QuickPollResultInformation Message.");
            }
            return(null);
        }
コード例 #3
0
            private void SendPollResultInformation( QuickPollResultModel result, Group receivers )
            {
                Message message, poll, res;
                message = new PresentationInformationMessage( this.m_Service.m_Presentation );
                message.Group = receivers;
                poll = new QuickPollInformationMessage( this.m_Service.m_QuickPoll );
                poll.Group = receivers;
                message.InsertChild( poll );
                res = new QuickPollResultInformationMessage( result );
                res.Group = receivers;
                poll.InsertChild( res );

                this.m_Service.m_Sender.Send( message );
            }