Пример #1
0
 public SlideMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.LocalId = (!SerializedPacket.IsNullPacket(p.PeekNextPart())) ?
                    new LocalId(p.PeekNextPart()) : null; p.GetNextPart();
     this.Title  = SerializedPacket.DeserializeString(p.GetNextPart());
     this.Zoom   = SerializedPacket.DeserializeFloat(p.GetNextPart());
     this.Bounds = SerializedPacket.DeserializeRectangle(p.GetNextPart());
     this.SlideBackgroundColor = SerializedPacket.DeserializeColor(p.GetNextPart());
     this.SubmissionSlideGuid  = SerializedPacket.DeserializeGuid(p.GetNextPart());
     this.SubmissionStyle      = (SlideModel.StudentSubmissionStyle)SerializedPacket.DeserializeLong(p.GetNextPart());
     this.Disposition          = (SlideDisposition)SerializedPacket.DeserializeLong(p.GetNextPart());
     this.AssociationSlideId   = SerializedPacket.DeserializeGuid(p.GetNextPart());
 }
Пример #2
0
 public SlideModel(Guid id, LocalId localId, SlideDisposition disposition, Rectangle bounds)
 {
     this.m_Id = id;
     this.m_LocalId = localId;
     this.m_Disposition = disposition;
     this.m_ContentSheets = new SheetCollection(this, "ContentSheets");
     this.m_AnnotationSheets = new SheetCollection(this, "AnnotationSheets");
     this.m_Bounds = bounds;
     this.m_Title = "";
     this.m_Zoom = 1f;
     this.m_BackgroundColor = Color.Empty;
     this.m_SubmissionSlideGuid = Guid.Empty;
     this.m_SubmissionStyle = StudentSubmissionStyle.Normal;
 }
Пример #3
0
 public SlideModel(Guid id, LocalId localId, SlideDisposition disposition, Rectangle bounds)
 {
     this.m_Id                  = id;
     this.m_LocalId             = localId;
     this.m_Disposition         = disposition;
     this.m_ContentSheets       = new SheetCollection(this, "ContentSheets");
     this.m_AnnotationSheets    = new SheetCollection(this, "AnnotationSheets");
     this.m_Bounds              = bounds;
     this.m_Title               = "";
     this.m_Zoom                = 1f;
     this.m_BackgroundColor     = Color.Empty;
     this.m_SubmissionSlideGuid = Guid.Empty;
     this.m_SubmissionStyle     = StudentSubmissionStyle.Normal;
     this.m_Visited             = false;
 }
Пример #4
0
        public SlideModel(Guid id, LocalId localId, SlideDisposition disposition, Rectangle bounds, Guid associationId)
            : this(id, localId, disposition, bounds)
        {
            this.m_AssociationId = associationId;

            //If this is a student submission, the associationID should be set.  In this case we
            //gather some extra information about the association slide and deck.
            if (!m_AssociationId.Equals(Guid.Empty))
            {
                PresentationModel pres = PresentationModel.CurrentPresentation;
                if (pres != null)
                {
                    PresentationModel.DeckTraversalCollection traversals;
                    traversals = pres.DeckTraversals;
                    foreach (DeckTraversalModel dtm in traversals)
                    {
                        DeckModel deck;
                        using (Synchronizer.Lock(dtm.SyncRoot)) {
                            deck = dtm.Deck;
                        }
                        Guid                 deckId;
                        DeckDisposition      deckDisp;
                        TableOfContentsModel toc;
                        using (Synchronizer.Lock(deck.SyncRoot)) {
                            deckId   = deck.Id;
                            deckDisp = deck.Disposition;
                            toc      = deck.TableOfContents;
                        }
                        TableOfContentsModel.Entry tocEntry = toc.GetEntryBySlideId(m_AssociationId);
                        if (tocEntry != null)
                        {
                            using (Synchronizer.Lock(tocEntry.SyncRoot)) {
                                m_AssociationSlideIndex = tocEntry.IndexInParent;
                            }
                            m_AssociationDeckDispostion = deckDisp;
                            m_AssociationDeckId         = deckId;
                            break;
                        }
                    }
                }
            }
        }
Пример #5
0
 public SlideMessage(SlideModel slide) : base(slide.Id)
 {
     this.AddLocalRef(slide);
     this.LocalId = slide.LocalId;
     using (Synchronizer.Lock(slide.SyncRoot)) {
         this.Zoom   = slide.Zoom;
         this.Bounds = slide.Bounds;
         this.Title  = slide.Title;
         this.SlideBackgroundColor    = slide.BackgroundColor;
         this.SlideBackgroundTemplate = slide.BackgroundTemplate;
         this.SubmissionSlideGuid     = slide.SubmissionSlideGuid;
         this.Visited            = slide.Visited;
         this.SubmissionStyle    = slide.SubmissionStyle;
         this.Disposition        = slide.Disposition;
         this.AssociationSlideId = slide.AssociationId;
         if (!this.AssociationSlideId.Equals(Guid.Empty))
         {
             AddAssociationExtension(slide);
         }
     }
 }
Пример #6
0
        public SlideModel(Guid id, LocalId localId, SlideDisposition disposition, Rectangle bounds, Guid associationId)
            : this(id, localId, disposition, bounds)
        {
            this.m_AssociationId = associationId;

            //If this is a student submission, the associationID should be set.  In this case we
            //gather some extra information about the association slide and deck.
            if (!m_AssociationId.Equals(Guid.Empty)) {
                PresentationModel pres = PresentationModel.CurrentPresentation;
                if (pres != null) {
                    PresentationModel.DeckTraversalCollection traversals;
                    using (Synchronizer.Lock(pres.SyncRoot)) {
                        traversals = PresentationModel.CurrentPresentation.DeckTraversals;
                    }
                    foreach (DeckTraversalModel dtm in traversals) {
                        DeckModel deck;
                        using (Synchronizer.Lock(dtm.SyncRoot)) {
                            deck = dtm.Deck;
                        }
                        Guid deckId;
                        DeckDisposition deckDisp;
                        TableOfContentsModel toc;
                        using (Synchronizer.Lock(deck.SyncRoot)) {
                            deckId = deck.Id;
                            deckDisp = deck.Disposition;
                            toc = deck.TableOfContents;
                        }
                        TableOfContentsModel.Entry tocEntry = toc.GetEntryBySlideId(m_AssociationId);
                        if (tocEntry != null) {
                            using (Synchronizer.Lock(tocEntry.SyncRoot)) {
                                m_AssociationSlideIndex = tocEntry.IndexInParent;
                            }
                            m_AssociationDeckDispostion = deckDisp;
                            m_AssociationDeckId = deckId;
                            break;
                        }
                    }
                }
            }
        }
Пример #7
0
 public SlideModel(Guid id, LocalId localId, SlideDisposition disposition) : this(id, localId, disposition, Rectangle.Empty)
 {
 }
Пример #8
0
 public SlideMessage(SlideModel slide)
     : base(slide.Id)
 {
     this.AddLocalRef( slide );
     this.LocalId = slide.LocalId;
     using(Synchronizer.Lock(slide.SyncRoot)) {
         this.Zoom = slide.Zoom;
         this.Bounds = slide.Bounds;
         this.Title = slide.Title;
         this.SlideBackgroundColor = slide.BackgroundColor;
         this.SubmissionSlideGuid = slide.SubmissionSlideGuid;
         this.SubmissionStyle = slide.SubmissionStyle;
         this.Disposition = slide.Disposition;
         this.AssociationSlideId = slide.AssociationId;
         if (!this.AssociationSlideId.Equals(Guid.Empty)) {
             AddAssociationExtension(slide);
         }
     }
 }
Пример #9
0
 public SlideMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.LocalId = (!SerializedPacket.IsNullPacket( p.PeekNextPart() )) ?
         new LocalId( p.PeekNextPart() ) : null; p.GetNextPart();
     this.Title = SerializedPacket.DeserializeString( p.GetNextPart() );
     this.Zoom = SerializedPacket.DeserializeFloat( p.GetNextPart() );
     this.Bounds = SerializedPacket.DeserializeRectangle( p.GetNextPart() );
     this.SlideBackgroundColor = SerializedPacket.DeserializeColor( p.GetNextPart() );
     this.SubmissionSlideGuid = SerializedPacket.DeserializeGuid( p.GetNextPart() );
     this.SubmissionStyle = (SlideModel.StudentSubmissionStyle)SerializedPacket.DeserializeLong( p.GetNextPart() );
     this.Disposition = (SlideDisposition)SerializedPacket.DeserializeLong( p.GetNextPart() );
     this.AssociationSlideId = SerializedPacket.DeserializeGuid( p.GetNextPart() );
 }
Пример #10
0
 public SlideModel(Guid id, LocalId localId, SlideDisposition disposition)
     : this(id, localId, disposition, Rectangle.Empty)
 {
 }