예제 #1
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);
            }
        }
        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);
        }
예제 #3
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);
        }
예제 #4
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);
        }