Ejemplo n.º 1
0
        private void HandleSlideContentAdded(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            ByteArray hash = ((ByteArray)args.Added);

            // For the purposes of ForceUpdate, this information is sent by SendAllSlidesAndContent.

            Message message, deck;

            message = new PresentationInformationMessage(this.m_Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.m_Deck));
            deck.InsertChild(new DeckSlideContentMessage(this.m_Deck, hash));

            if ((this.m_Deck.Disposition & (DeckDisposition.StudentSubmission | DeckDisposition.QuickPoll)) != 0)
            {
                // If we get here in response to a new student submission received
                // we don't need to send anything because we can assume the public display
                // already has the slide, however if the instructor manually adds new
                // slides to a student submission deck, the public display may not have them.
                // For now we send in both cases, but that could be improved.
                // In any case we only send slides from a Student Submission deck to Public nodes.
                message.Group = Group.Submissions;
            }
            this.m_Sender.Send(message, MessagePriority.Low);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Event handler that is invoked when a slide's content has changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args_"></param>
        private void HandleSlideContentAdded(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            ByteArray hash = ((ByteArray)args.Added);

            ImageHashtable.ImageHashTableItem Content;

            // Get the slide content from the source deck
            using (Synchronizer.Lock(this.SourceDeck.SyncRoot)) {
                Image image = this.SourceDeck.GetSlideContent(hash);

                if (image == null)
                {
                    throw new ArgumentException("The specified ByteArray does not map to slide content in the specified deck.", "hash");
                }

                Content = new ImageHashtable.ImageHashTableItem(hash, image);
            }

            // Add the slide content to the destination deck
            using (Synchronizer.Lock(this.DestinationDeck.SyncRoot)) {
                // Note: If the deck already has content with this hash, nothing will happen.
                this.DestinationDeck.AddSlideContent(Content.key, Content.image);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Event handler that is invoked when a slide is added to the deck
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args_"></param>
        private void HandleSlideAdded(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide = ((SlideModel)args.Added);

            // Get the best associated slide
            bool bAdded = false;

            using (Synchronizer.Lock(this.m_DestDeck.SyncRoot)) {
                foreach (SlideModel s in this.m_DestDeck.Slides)
                {
                    if (SlidesEqual(s, slide))
                    {
                        // Add the association to the list
                        this.m_SlideMatches.Add(new SlideMatch(this.m_Sender, slide, s));
                        bAdded = true;
                        break;
                    }
                }

                // New slide, perhaps whiteboard, so add one
                if (!bAdded)
                {
                    // CMPRINCE TODO: This need to be done better
                    // Insert the new slide
//                    this.m_DestDeck.InsertSlide(
                    // Add the association to the list
                }
            }
        }
Ejemplo n.º 4
0
        private void HandleSlideAdded(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide = ((SlideModel)args.Added);

            this.AttachSlide(slide);
        }
Ejemplo n.º 5
0
        private void HandleSlideAdded(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide     = ((SlideModel)args.Added);
            Group      receivers = Group.AllParticipant;

            if ((this.m_Deck.Disposition & (DeckDisposition.StudentSubmission | DeckDisposition.QuickPoll)) != 0)
            {
                receivers = Group.Submissions;
            }
            this.SendSlideInformation(slide, receivers);
        }
Ejemplo n.º 6
0
        private void HandleSlideRemoved(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide = ((SlideModel)args.Removed);

            using (Synchronizer.Lock(this.m_SlideNetworkServices.SyncRoot)) {
                SSSlideNetworkService service = ((SSSlideNetworkService)this.m_SlideNetworkServices[slide]);
                if (service != null)
                {
                    this.m_SlideNetworkServices.Remove(service);
                    service.Dispose();
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Event handler that is invoked when a slide is removed from the deck
        /// Never remove a slide, just remove the mappings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args_"></param>
        private void HandleSlideRemoved(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide = ((SlideModel)args.Removed);

            ArrayList toRemove = new ArrayList();

            foreach (SlideMatch match in this.m_SlideMatches)
            {
                if (match.SourceSlide == slide)
                {
                    toRemove.Add(match);
                }
            }
            foreach (SlideMatch match in toRemove)
            {
                this.m_SlideMatches.Remove(match);
            }
        }
Ejemplo n.º 8
0
        private void HandleSlideRemoved(object sender, PropertyEventArgs args_)
        {
            PropertyCollectionEventArgs args = ((PropertyCollectionEventArgs)args_);
            SlideModel slide = ((SlideModel)args.Removed);

            using (Synchronizer.Lock(this.m_SlideNetworkServices.SyncRoot)) {
                SlideNetworkService service = ((SlideNetworkService)this.m_SlideNetworkServices[slide]);
                if (service != null)
                {
                    this.m_SlideNetworkServices.Remove(service);
                    service.Dispose();
                }
            }

            Message message, deck;

            message = new PresentationInformationMessage(this.m_Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.m_Deck));
            deck.InsertChild(new SlideDeletedMessage(slide));
            this.m_Sender.Send(message);
        }