/// <summary>
        /// This is similar to the texthelpermethod, but here we send a removal message
        /// if the message is private. I am having two different methods for the sake of seperating
        /// the two different types of messages.
        /// </summary>
        /// <param name="receivers"></param>
        private void SendPublicHelper(Group receivers)
        {
            Message message, deck, slide;
            message = new PresentationInformationMessage(this.Presentation);
            message.Group = receivers;
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide = new SlideInformationMessage(this.Slide));

            ///send the text message
            bool sheet_is_public;
            using (Synchronizer.Lock(sheet_.SyncRoot)) {
                sheet_is_public = sheet_.IsPublic;
            }
            ///if the sheet is private, the users should not be able to see any part of the sheet,
            ///so we should just remove a private sheet.
            if (sheet_is_public) {
                slide.InsertChild(new TextSheetMessage(this.sheet_, this.SheetCollectionSelector));
            } else {
                slide.InsertChild(new SheetRemovedMessage(this.sheet_, this.SheetCollectionSelector));
            }

            using (Synchronizer.Lock(this.Slide.SyncRoot)) {
                message.Tags = new MessageTags();
                message.Tags.SlideID = this.Slide.Id;
            }

            this.Sender.Send(message);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// If the slide size (Zoom) or background color changed, return a new RTUpdate
        /// </summary>
        /// <param name="sim"></param>
        /// <returns></returns>
        internal object UpdateSlideInformation(UW.ClassroomPresenter.Network.Messages.Presentation.SlideInformationMessage sim)
        {
            //if (!sim.SubmissionSlideGuid.Equals(Guid.Empty)) {
            //    Debug.WriteLine("SubmissionSlideGuid: " + sim.SubmissionSlideGuid.ToString());
            //}
            if ((sim.Parent != null) && (sim.Parent.Parent != null) &&
                (sim.Parent is CP3Msgs.DeckInformationMessage) &&
                (sim.Parent.Parent is CP3Msgs.PresentationInformationMessage))
            {
                string w;
                object o = toc.UpdateZoomAndColorForSlide(sim, out w);
                if ((w != null) && (w != ""))
                {
                    warning += w;
                }
                return(o);
            }

            // Normal slides are 720x540, but XPS slides are larger.  We need to know this so we can scale the ink correctly.
            if (this.customSlideBounds.ContainsKey((Guid)sim.TargetId))
            {
                this.customSlideBounds.Remove((Guid)sim.TargetId);
            }
            this.customSlideBounds.Add((Guid)sim.TargetId, new SizeF((float)sim.Bounds.Width, (float)sim.Bounds.Height));

            return(null);
        }
        internal object UpdateZoomAndColorForSlide(CP3Msgs.SlideInformationMessage sim, out string warning)
        {
            Guid  slideId = (Guid)sim.TargetId;
            float zoom    = sim.Zoom;
            Color color   = sim.SlideBackgroundColor;

            warning = "";
            if (!this.tocBySlideId.ContainsKey(slideId))
            {
                return(null);
            }
            TocEntry entry = (TocEntry)this.tocBySlideId[slideId];

            if ((entry.SlideSize != zoom) ||
                (!entry.BackgroundColor.Equals(color)))
            {
                if (!entry.BackgroundColor.Equals(color))
                {
                    Debug.WriteLine("*****Update to slide background color.");
                }
                entry.SlideSize       = zoom;
                entry.BackgroundColor = color;
                if (!UpdateAssociation(entry))
                {
                    return(null);
                }


                return(entry.ToRtUpdate());
            }
            return(null);
        }
Ejemplo n.º 4
0
        public void SendSheetInformation(SheetModel sheet, SheetMessage.SheetCollection selector, Group receivers)
        {
            // TODO: Also pass the index so the sheet can be inserted into the correct index on the remote side.
            Message message, deck, slide;

            message                  = new PresentationInformationMessage(this.m_Presentation);
            message.Group            = receivers;
            message.InsertChild(deck = new DeckInformationMessage(this.m_Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(this.m_Slide));
            Message sm = SheetMessage.RemoteForSheet(sheet, selector);

            //if sm is null that means that the sheet is an instructor note and shouldn't be sent.
            if (sm != null)
            {
                slide.InsertChild(sm);
            }
            using (Synchronizer.Lock(this.m_Slide.SyncRoot)) {
                message.Tags         = new MessageTags();
                message.Tags.SlideID = this.m_Slide.Id;
            }
            if (sheet is ImageSheetModel && ((ImageSheetModel)sheet).Image != null)
            {
                using (Synchronizer.Lock(sheet.SyncRoot)) {
                    this.m_Sender.Send(message);
                }
            }
            else
            {
                this.m_Sender.Send(message);
            }
        }
Ejemplo n.º 5
0
            protected override void TearDownMember(int index, object member, object tag)
            {
                if (tag == null)
                {
                    return;
                }

                SheetModel sheet = ((SheetModel)member);

                Message message, deck, slide;

                message = new PresentationInformationMessage(this.m_Service.m_Presentation);
                message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
                deck.InsertChild(slide   = new SlideInformationMessage(this.m_Service.m_Slide));
                slide.InsertChild(new SheetRemovedMessage(sheet, this.m_Selector));

                using (Synchronizer.Lock(this.m_Service.m_Slide.SyncRoot)) {
                    message.Tags         = new MessageTags();
                    message.Tags.SlideID = this.m_Service.m_Slide.Id;
                }

                this.m_Service.m_Sender.Send(message);

                ((SheetNetworkService)tag).Dispose();
            }
Ejemplo n.º 6
0
 private void SendImageHelper(Group receivers)
 {
     //Don't send message if it's an instructor note.
     if (this.sheet_.Disposition != SheetDisposition.Instructor)
     {
         Message message, deck, slide;
         message                  = new PresentationInformationMessage(this.Presentation);
         message.Group            = receivers;
         message.InsertChild(deck = new DeckInformationMessage(this.Deck));
         deck.InsertChild(slide   = new SlideInformationMessage(this.Slide));
         slide.InsertChild(new ImageSheetMessage(this.sheet_, this.SheetCollectionSelector));
         using (Synchronizer.Lock(m_SlideModel.SyncRoot)) {
             message.Tags         = new MessageTags();
             message.Tags.SlideID = m_SlideModel.Id;
         }
         if (this.sheet_.Image != null)
         {
             using (Synchronizer.Lock(this.sheet_.SyncRoot)) {
                 this.Sender.Send(message);
             }
         }
         else
         {
             this.Sender.Send(message);
         }
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// This is similar to the texthelpermethod, but here we send a removal message
        /// if the message is private. I am having two different methods for the sake of seperating
        /// the two different types of messages.
        /// </summary>
        /// <param name="receivers"></param>
        private void SendPublicHelper(Group receivers)
        {
            Message message, deck, slide;

            message                  = new PresentationInformationMessage(this.Presentation);
            message.Group            = receivers;
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(this.Slide));

            ///send the text message
            bool sheet_is_public;

            using (Synchronizer.Lock(sheet_.SyncRoot)) {
                sheet_is_public = sheet_.IsPublic;
            }
            ///if the sheet is private, the users should not be able to see any part of the sheet,
            ///so we should just remove a private sheet.
            if (sheet_is_public)
            {
                slide.InsertChild(new TextSheetMessage(this.sheet_, this.SheetCollectionSelector));
            }
            else
            {
                slide.InsertChild(new SheetRemovedMessage(this.sheet_, this.SheetCollectionSelector));
            }

            using (Synchronizer.Lock(this.Slide.SyncRoot)) {
                message.Tags         = new MessageTags();
                message.Tags.SlideID = this.Slide.Id;
            }

            this.Sender.Send(message);
        }
Ejemplo n.º 8
0
        private void HandleInkDeletingHelper(string[] ids)
        {
            Message message, deck, slide, sheet;

            message = new PresentationInformationMessage(this.Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(GetSubmissionSlideModel(), false));
            slide.InsertChild(sheet  = new InkSheetStrokesDeletingMessage(this.m_Sheet, this.SheetCollectionSelector, ids));
            this.Sender.Send(message);
        }
        private void HandleCurrentDrawingAttributesChanged(object sender, PropertyEventArgs args)
        {
            Message message, deck, slide, sheet;

            message = new PresentationInformationMessage(this.Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(GetSubmissionSlideModel(), false));
            slide.InsertChild(sheet  = SheetMessage.RemoteForSheet(this.Sheet, this.SheetCollectionSelector));
            this.Sender.Send(message);
        }
Ejemplo n.º 10
0
        private void HandleInkAddedHelper(Ink extracted)
        {
            Message message, deck, slide, sheet;

            message = new PresentationInformationMessage(this.Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(GetSubmissionSlideModel(), false));
            slide.InsertChild(sheet  = new InkSheetStrokesAddedMessage(this.m_Sheet, (Guid)slide.TargetId, this.SheetCollectionSelector, extracted));
            sheet.AddOldestPredecessor(SheetMessage.RemoteForSheet(this.m_Sheet, this.SheetCollectionSelector));
            this.Sender.Send(message);
        }
Ejemplo n.º 11
0
            private void SendEntryAdded(TableOfContentsModel.Entry entry, Group receivers)
            {
                Message message, deck, slide;

                message                  = new PresentationInformationMessage(this.m_Service.m_Presentation);
                message.Group            = receivers;
                message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
                deck.InsertChild(slide   = new SlideInformationMessage(entry.Slide));
                slide.InsertChild(new TableOfContentsEntryMessage(entry));
                this.m_Service.m_Sender.Send(message);
            }
Ejemplo n.º 12
0
        private void HandleInkDeletingHelper(string[] ids)
        {
            Message message, deck, slide, sheet;

            message = new PresentationInformationMessage(this.Presentation);
            message.InsertChild(deck    = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide      = new SlideInformationMessage(this.Slide));
            slide.InsertChild(sheet     = new InkSheetStrokesDeletingMessage(this.m_Sheet, this.SheetCollectionSelector, ids));
            message.Tags                = new MessageTags();
            message.Tags.SlideID        = m_SlideID;
            message.Tags.BridgePriority = MessagePriority.Higher;
            this.Sender.Send(message);
        }
Ejemplo n.º 13
0
        protected virtual void HandleBoundsChanged(object sender, PropertyEventArgs args)
        {
            // Send a generic update with information about the sheet (including the new bounds).
            Message message, deck, slide, sheet;

            message = new PresentationInformationMessage(this.Presentation);
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(this.Slide));
            slide.InsertChild(sheet  = SheetMessage.RemoteForSheet(this.Sheet, this.SheetCollectionSelector));
            using (Synchronizer.Lock(this.m_Slide.SyncRoot)) {
                message.Tags         = new MessageTags();
                message.Tags.SlideID = this.m_Slide.Id;
            }
            this.Sender.Send(message);
        }
Ejemplo n.º 14
0
            protected override void TearDownMember(int index, object member, object tag)
            {
                if (tag == null)
                {
                    return;
                }

                TableOfContentsModel.Entry entry = ((TableOfContentsModel.Entry)member);

                Message message, deck, slide;

                message = new PresentationInformationMessage(this.m_Service.m_Presentation);
                message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
                deck.InsertChild(slide   = new SlideInformationMessage(entry.Slide));
                slide.InsertChild(new TableOfContentsEntryRemovedMessage(entry));

                this.m_Service.m_Sender.Send(message);
            }
Ejemplo n.º 15
0
        private void SendTextHelper(Group receivers)
        {
            Message message, deck, slide;

            message                  = new PresentationInformationMessage(this.Presentation);
            message.Group            = receivers;
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide   = new SlideInformationMessage(this.Slide));

            ///send the text message
            slide.InsertChild(new TextSheetMessage(this.sheet_, this.SheetCollectionSelector));

            using (Synchronizer.Lock(this.Slide.SyncRoot)) {
                message.Tags         = new MessageTags();
                message.Tags.SlideID = this.Slide.Id;
            }

            this.Sender.Send(message);
        }
 private void SendQuickPollSheetHelper( Group receivers )
 {
     //Don't send message if it's an instructor note.
     if( this.sheet.Disposition != SheetDisposition.Instructor ) {
         Message message, deck, poll, slide;
         message = new PresentationInformationMessage( this.Presentation );
         message.Group = receivers;
         message.InsertChild( deck = new DeckInformationMessage( this.Deck ) );
         deck.InsertChild( slide = new SlideInformationMessage( this.Slide ) );
         using( Synchronizer.Lock( this.Sheet.SyncRoot ) ) {
             slide.InsertChild( poll = new QuickPollInformationMessage( this.sheet.QuickPoll ) );
         }
         poll.InsertChild( new QuickPollSheetMessage( this.sheet, this.SheetCollectionSelector ) );
         using( Synchronizer.Lock( m_SlideModel.SyncRoot ) ) {
             message.Tags = new MessageTags();
             message.Tags.SlideID = m_SlideModel.Id;
         }
         this.Sender.Send( message );
     }
 }
 private void SendQuickPollSheetHelper(Group receivers)
 {
     //Don't send message if it's an instructor note.
     if (this.sheet.Disposition != SheetDisposition.Instructor)
     {
         Message message, deck, poll, slide;
         message                  = new PresentationInformationMessage(this.Presentation);
         message.Group            = receivers;
         message.InsertChild(deck = new DeckInformationMessage(this.Deck));
         deck.InsertChild(slide   = new SlideInformationMessage(this.Slide));
         using (Synchronizer.Lock(this.Sheet.SyncRoot)) {
             slide.InsertChild(poll = new QuickPollInformationMessage(this.sheet.QuickPoll));
         }
         poll.InsertChild(new QuickPollSheetMessage(this.sheet, this.SheetCollectionSelector));
         using (Synchronizer.Lock(m_SlideModel.SyncRoot)) {
             message.Tags         = new MessageTags();
             message.Tags.SlideID = m_SlideModel.Id;
         }
         this.Sender.Send(message);
     }
 }
Ejemplo n.º 18
0
        /// <summary>
        /// When a new quickpoll is started we get this with parents: QuickPollInformationMessage, Slide..,Deck..,Presentation..
        /// The SheetMessage base class has dimensions, but they appear to all be zeros.
        /// </summary>
        /// <param name="quickPollSheetMessage"></param>
        /// <returns></returns>
        internal object AddQuickPollSheet(UW.ClassroomPresenter.Network.Messages.Presentation.QuickPollSheetMessage qpsm)
        {
            if ((qpsm.Parent is CP3Msgs.QuickPollInformationMessage) &&
                (qpsm.Parent.Parent is CP3Msgs.SlideInformationMessage) &&
                (qpsm.Parent.Parent.Parent is CP3Msgs.DeckInformationMessage) &&
                (qpsm.Parent.Parent.Parent.Parent is CP3Msgs.PresentationInformationMessage))
            {
                CP3Msgs.QuickPollInformationMessage qpim = (CP3Msgs.QuickPollInformationMessage)qpsm.Parent;
                CP3Msgs.SlideInformationMessage     sim  = (CP3Msgs.SlideInformationMessage)qpsm.Parent.Parent;
                CP3Msgs.DeckInformationMessage      dim  = (CP3Msgs.DeckInformationMessage)qpsm.Parent.Parent.Parent;
                CP3Msgs.QuickPollMessage            qpm  = (CP3Msgs.QuickPollMessage)qpim;

                // Note: OriginalSlideId is not in the TOC.  What is that??
                //TableOfContents.TocEntry te = toc.LookupBySlideId(qpModel.OriginalSlideId);

                /// sim.TargetID seems to give us a good TOC entry for the quickpoll
                /// slide with association information filled in correctly:
                TableOfContents.TocEntry qptoc = toc.LookupBySlideId((Guid)sim.TargetId);
                if (qptoc == null)
                {
                    Debug.WriteLine("***Failed to find slide for QuickPoll Sheet!");
                    return(null);
                }

                m_QuickPollAggregator.AddQuickPoll(qpm.Model);
                toc.AddQuickPollIdForSlide((Guid)sim.TargetId, qpm.Model.Id);

                //Send the initial RtQuickPoll with empty results
                int[] results = new int[0];
                ArchiveRTNav.RTQuickPoll rtqp = new ArchiveRTNav.RTQuickPoll((ArchiveRTNav.QuickPollStyle)qpm.Model.PollStyle, results, qptoc.DeckId, qptoc.SlideIndex);
                return(rtqp);
            }
            else
            {
                Debug.WriteLine("****Unexpected QuickPollSheetMessage: " + qpsm.ToString());
            }
            return(null);
        }
 private void SendImageHelper(Group receivers)
 {
     //Don't send message if it's an instructor note.
     if (this.sheet_.Disposition != SheetDisposition.Instructor) {
         Message message, deck, slide;
         message = new PresentationInformationMessage(this.Presentation);
         message.Group = receivers;
         message.InsertChild(deck = new DeckInformationMessage(this.Deck));
         deck.InsertChild(slide = new SlideInformationMessage(this.Slide));
         slide.InsertChild(new ImageSheetMessage(this.sheet_, this.SheetCollectionSelector));
         using (Synchronizer.Lock(m_SlideModel.SyncRoot)) {
             message.Tags = new MessageTags();
             message.Tags.SlideID = m_SlideModel.Id;
         }
         if (this.sheet_.Image != null) {
             using (Synchronizer.Lock(this.sheet_.SyncRoot)) {
                 this.Sender.Send(message);
             }
         }
         else
             this.Sender.Send(message);
     }
 }
 private void HandleInkDeletingHelper(string[] ids)
 {
     Message message, deck, slide, sheet;
     message = new PresentationInformationMessage(this.Presentation);
     message.InsertChild(deck = new DeckInformationMessage(this.Deck));
     deck.InsertChild(slide = new SlideInformationMessage( GetSubmissionSlideModel(), false ));
     slide.InsertChild(sheet = new InkSheetStrokesDeletingMessage(this.m_Sheet, this.SheetCollectionSelector, ids));
     this.Sender.Send(message);
 }
 private void HandleInkDeletingHelper(string[] ids)
 {
     Message message, deck, slide, sheet;
     message = new PresentationInformationMessage(this.Presentation);
     message.InsertChild(deck = new DeckInformationMessage(this.Deck));
     deck.InsertChild(slide = new SlideInformationMessage(this.Slide));
     slide.InsertChild(sheet = new InkSheetStrokesDeletingMessage(this.m_Sheet, this.SheetCollectionSelector, ids));
     message.Tags = new MessageTags();
     message.Tags.SlideID = m_SlideID;
     message.Tags.BridgePriority = MessagePriority.Higher;
     this.Sender.Send(message);
 }
        /// <summary>
        /// Send a network message with the updated deck traversal
        /// </summary>
        /// <param name="receivers"></param>
        private void SendCurrentDeckTraversalChange(Group receivers)
        {
            using(Synchronizer.Lock(this.m_Instructor.SyncRoot)) {
                DeckTraversalModel traversal = this.m_Instructor.CurrentDeckTraversal;
                if(traversal != null) {
                    Message message = new InstructorMessage(this.m_Instructor);
                    message.Group = receivers;

                    // Create a SlideMessage/TableOfContentsEntryMessage which will be the
                    // InstructorCurrentDeckTraversalChangedMessage's predecessor.
                    using (Synchronizer.Lock(traversal.SyncRoot)) {
                        Message slide = new SlideInformationMessage(traversal.Current.Slide);
                        using (Synchronizer.Lock(traversal.Deck.SyncRoot)) {
                            if( (traversal.Deck.Disposition & (DeckDisposition.StudentSubmission | DeckDisposition.QuickPoll) ) != 0 )
                                slide.Group = Groups.Group.Submissions;
                        }
                        slide.InsertChild(new TableOfContentsEntryMessage(traversal.Current));
                        message.InsertChild(slide);
                    }

                    message.InsertChild(new InstructorCurrentDeckTraversalChangedMessage(traversal));

            #if DEBUG
                    // Add logging of slide change events
                    string pres_name = "";
                    using( Synchronizer.Lock( this.m_CurrentPresentation.SyncRoot ) )
                        pres_name = this.m_CurrentPresentation.HumanName;

                    string deck_name = "";
                    using( Synchronizer.Lock( traversal.Deck.SyncRoot ) )
                        deck_name = traversal.Deck.HumanName;

                    int slide_index = 0;
                    Guid slide_guid = Guid.Empty;
                    using( Synchronizer.Lock( traversal.SyncRoot ) ) {
                        if( traversal.Current != null )
                            using (Synchronizer.Lock(traversal.Current.SyncRoot)) {
                                slide_index = traversal.Current.IndexInParent;
                                using (Synchronizer.Lock(traversal.Current.Slide.SyncRoot)) {
                                    slide_guid = traversal.Current.Slide.Id;
                                }
                            }
                    }

                    Debug.WriteLine( string.Format( "DECK CHANGE ({0}): Pres -- {1}, Deck -- {2}, Slide -- {3}, Guid -- {4}",
                        System.DateTime.Now.Ticks, pres_name, deck_name, slide_index, slide_guid ) );
            #endif
                    message.Tags = new MessageTags();
                    message.Tags.BridgePriority = MessagePriority.Higher;

                    this.Sender.Send(message);
                }
            }
        }
Ejemplo n.º 23
0
 public void SendSheetInformation( SheetModel sheet, SheetMessage.SheetCollection selector, Group receivers )
 {
     // TODO: Also pass the index so the sheet can be inserted into the correct index on the remote side.
     Message message, deck, slide;
     message = new PresentationInformationMessage( this.m_Presentation );
     message.Group = receivers;
     message.InsertChild( deck = new DeckInformationMessage( this.m_Deck ) );
     deck.InsertChild( slide = new SlideInformationMessage( this.m_Slide ) );
     Message sm = SheetMessage.RemoteForSheet(sheet, selector);
     //if sm is null that means that the sheet is an instructor note and shouldn't be sent.
     if (sm != null) {
         slide.InsertChild(sm);
     }
     using( Synchronizer.Lock( this.m_Slide.SyncRoot ) ) {
         message.Tags = new MessageTags();
         message.Tags.SlideID = this.m_Slide.Id;
     }
     if (sheet is ImageSheetModel && ((ImageSheetModel)sheet).Image != null) {
         using (Synchronizer.Lock(sheet.SyncRoot)) {
             this.m_Sender.Send( message );
         }
     }
     else
         this.m_Sender.Send(message);
 }
Ejemplo n.º 24
0
            protected override void TearDownMember(int index, object member, object tag)
            {
                if(tag == null) return;

                SheetModel sheet = ((SheetModel) member);

                Message message, deck, slide;
                message = new PresentationInformationMessage(this.m_Service.m_Presentation);
                message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
                deck.InsertChild(slide = new SlideInformationMessage(this.m_Service.m_Slide));
                slide.InsertChild(new SheetRemovedMessage(sheet, this.m_Selector));

                using (Synchronizer.Lock(this.m_Service.m_Slide.SyncRoot)) {
                    message.Tags = new MessageTags();
                    message.Tags.SlideID = this.m_Service.m_Slide.Id;
                }

                this.m_Service.m_Sender.Send(message);

                ((SheetNetworkService) tag).Dispose();
            }
            protected override void TearDownMember(int index, object member, object tag)
            {
                if(tag == null) return;

                TableOfContentsModel.Entry entry = ((TableOfContentsModel.Entry) member);

                Message message, deck, slide;
                message = new PresentationInformationMessage(this.m_Service.m_Presentation);
                message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
                deck.InsertChild(slide = new SlideInformationMessage(entry.Slide));
                slide.InsertChild(new TableOfContentsEntryRemovedMessage(entry));

                this.m_Service.m_Sender.Send(message);
            }
 private void HandleCurrentDrawingAttributesChanged(object sender, PropertyEventArgs args)
 {
     Message message, deck, slide, sheet;
     message = new PresentationInformationMessage(this.Presentation);
     message.InsertChild(deck = new DeckInformationMessage(this.Deck));
     deck.InsertChild(slide = new SlideInformationMessage(this.Slide));
     slide.InsertChild( sheet = SheetMessage.RemoteForSheet( this.Sheet, this.SheetCollectionSelector ) );
     message.Tags = new MessageTags();
     message.Tags.SlideID = m_SlideID;
     this.Sender.Send(message);
 }
            public TocEntry(CP3Msgs.TableOfContentsEntryMessage tocem, Guid deckid, CP3.Model.Presentation.DeckDisposition disposition, Guid ssDeckId)
            {
                deckAssociation          = Guid.Empty;
                associationSlideId       = Guid.Empty;
                this.deckTypeAssociation = DeckTypeEnum.Undefined;
                slideAssociation         = -1;
                deckId = deckid;

                deckType = DeckTypeEnum.Presentation;

                if ((disposition & CP3.Model.Presentation.DeckDisposition.Whiteboard) != 0)
                {
                    deckType = DeckTypeEnum.Whiteboard;
                }
                if ((disposition & CP3.Model.Presentation.DeckDisposition.StudentSubmission) != 0)
                {
                    deckType = DeckTypeEnum.StudentSubmission;
                    if (!ssDeckId.Equals(Guid.Empty))
                    {
                        deckId = ssDeckId;
                    }
                }
                if ((disposition & CP3.Model.Presentation.DeckDisposition.QuickPoll) != 0)
                {
                    deckType = DeckTypeEnum.QuickPoll;
                }

                slideId = (Guid)tocem.Parent.TargetId;

                //Debug code:
                //if (slideId.Equals(new Guid("96c09fe9-f0be-4421-9cf4-7d26032382a1"))) {
                //    Debug.WriteLine("Found slide.");
                //}

                title     = ((CP3Msgs.SlideInformationMessage)tocem.Parent).Title;
                slideSize = ((CP3Msgs.SlideInformationMessage)tocem.Parent).Zoom;

                ///If this is Color.Empty then the slide will use the Deck background color.  If that one is also
                ///Color.Empty, then it will default to white.
                backgroundColor = ((CP3Msgs.SlideInformationMessage)tocem.Parent).SlideBackgroundColor;

                associationSlideId = ((CP3Msgs.SlideInformationMessage)tocem.Parent).AssociationSlideId;
                if (tocem.PathFromRoot.Length == 1)
                {
                    slideIndex = tocem.PathFromRoot[0]; //This is a zero-based index.
                }

                if (!associationSlideId.Equals(Guid.Empty))
                {
                    //About CP3 build 1603 we added a message extension to help map SS slides back to the source slide in the presentation.
                    CP3Msgs.SlideInformationMessage sim = (CP3Msgs.SlideInformationMessage)tocem.Parent;
                    if (sim.Extension != null)
                    {
                        CP3.Misc.ExtensionWrapper extw = sim.Extension as CP3.Misc.ExtensionWrapper;
                        if (extw != null)
                        {
                            if (extw.ExtensionType.Equals(CP3Msgs.SlideAssociationExtension.ExtensionId))
                            {
                                CP3Msgs.SlideAssociationExtension assnExt = (CP3Msgs.SlideAssociationExtension)(extw.ExtensionObject);
                                this.associationSlideId = assnExt.SlideID;
                                this.deckAssociation    = assnExt.DeckID;
                                this.slideAssociation   = assnExt.SlideIndex;
                                if ((assnExt.DeckType & CP3.Model.Presentation.DeckDisposition.StudentSubmission) != 0)
                                {
                                    this.deckTypeAssociation = DeckTypeEnum.StudentSubmission;
                                }
                                if ((assnExt.DeckType & CP3.Model.Presentation.DeckDisposition.Whiteboard) != 0)
                                {
                                    this.deckTypeAssociation = DeckTypeEnum.Whiteboard;
                                }
                                if ((assnExt.DeckType & CP3.Model.Presentation.DeckDisposition.QuickPoll) != 0)
                                {
                                    this.deckTypeAssociation = DeckTypeEnum.QuickPoll;
                                }
                                if (assnExt.DeckType == CP3.Model.Presentation.DeckDisposition.Empty)
                                {
                                    this.deckTypeAssociation = DeckTypeEnum.Presentation;
                                }
                            }
                        }
                    }
                }
            }
 private void SendEntryAdded(TableOfContentsModel.Entry entry, Group receivers)
 {
     Message message, deck, slide;
     message = new PresentationInformationMessage(this.m_Service.m_Presentation);
     message.Group = receivers;
     message.InsertChild(deck = new DeckInformationMessage(this.m_Service.m_Deck));
     deck.InsertChild(slide = new SlideInformationMessage(entry.Slide));
     slide.InsertChild(new TableOfContentsEntryMessage(entry));
     this.m_Service.m_Sender.Send(message);
 }
Ejemplo n.º 29
0
 protected virtual void HandleBoundsChanged(object sender, PropertyEventArgs args)
 {
     // Send a generic update with information about the sheet (including the new bounds).
     Message message, deck, slide, sheet;
     message = new PresentationInformationMessage(this.Presentation);
     message.InsertChild(deck = new DeckInformationMessage(this.Deck));
     deck.InsertChild(slide = new SlideInformationMessage(this.Slide));
     slide.InsertChild( sheet = SheetMessage.RemoteForSheet( this.Sheet, this.SheetCollectionSelector ) );
     using (Synchronizer.Lock(this.m_Slide.SyncRoot)) {
         message.Tags = new MessageTags();
         message.Tags.SlideID = this.m_Slide.Id;
     }
     this.Sender.Send(message);
 }
 private void HandleInkAddedHelper(Ink extracted)
 {
     Message message, deck, slide, sheet;
     message = new PresentationInformationMessage(this.Presentation);
     message.InsertChild(deck = new DeckInformationMessage(this.Deck));
     deck.InsertChild(slide = new SlideInformationMessage( GetSubmissionSlideModel(), false ));
     slide.InsertChild(sheet = new InkSheetStrokesAddedMessage(this.m_Sheet, (Guid)slide.TargetId, this.SheetCollectionSelector, extracted));
     sheet.AddOldestPredecessor( SheetMessage.RemoteForSheet( this.m_Sheet, this.SheetCollectionSelector ) );
     this.Sender.Send(message);
 }
        private void SendTextHelper(Group receivers)
        {
            Message message, deck, slide;
            message = new PresentationInformationMessage(this.Presentation);
            message.Group = receivers;
            message.InsertChild(deck = new DeckInformationMessage(this.Deck));
            deck.InsertChild(slide = new SlideInformationMessage(this.Slide));

            ///send the text message
            slide.InsertChild(new TextSheetMessage(this.sheet_, this.SheetCollectionSelector));

            using (Synchronizer.Lock(this.Slide.SyncRoot)) {
                message.Tags = new MessageTags();
                message.Tags.SlideID = this.Slide.Id;
            }

            this.Sender.Send(message);
        }