public static Message ForSheet(SheetModel sheet, SheetCollection collection) { if (sheet is ImageSheetModel) { //If it's an instructor note, return null. if (sheet.Disposition == SheetDisposition.Instructor) return null; else return new ImageSheetMessage((ImageSheetModel)sheet, collection); } if(sheet is RealTimeInkSheetModel) return new RealTimeInkSheetInformationMessage((RealTimeInkSheetModel) sheet, collection); if(sheet is InkSheetModel) return new InkSheetInformationMessage((InkSheetModel) sheet, collection); if(sheet is TextSheetModel) return new TextSheetMessage((TextSheetModel) sheet, collection); if( sheet is QuickPollSheetModel ) { Message poll; using( Synchronizer.Lock( sheet.SyncRoot ) ) { poll = new QuickPollInformationMessage( ((QuickPollSheetModel)sheet).QuickPoll ); } poll.InsertChild( new QuickPollSheetMessage( (QuickPollSheetModel)sheet, collection ) ); return poll; } throw new ArgumentException("Unknown sheet type: " + sheet.GetType().ToString()); }
/// <summary> /// Construct the sheet message /// </summary> /// <param name="sheet">The sheet to construct the message from</param> /// <param name="collection">The collection that this sheet is part of</param> public QuickPollSheetMessage( QuickPollSheetModel sheet, SheetCollection collection ) : base(sheet, collection) { using( Synchronizer.Lock( sheet.SyncRoot ) ) { this.Id = sheet.QuickPoll.Id; } }
/// <summary> /// Construct the sheet message /// </summary> /// <param name="sheet">The sheet to construct the message from</param> /// <param name="collection">The collection that this sheet is part of</param> public QuickPollSheetMessage(QuickPollSheetModel sheet, SheetCollection collection) : base(sheet, collection) { using (Synchronizer.Lock(sheet.SyncRoot)) { this.Id = sheet.QuickPoll.Id; } }
public static Message RemoteForSheet(SheetModel sheet, SheetCollection collection) { SheetModel newModel = null; if (sheet is ImageSheetModel) { newModel = sheet; } else if (sheet is RealTimeInkSheetModel) { using (Synchronizer.Lock(sheet.SyncRoot)) { newModel = new RealTimeInkSheetModel(sheet.Id, sheet.Disposition | SheetDisposition.Remote, sheet.Bounds); using (Synchronizer.Lock(newModel.SyncRoot)) ((RealTimeInkSheetModel)newModel).CurrentDrawingAttributes = ((RealTimeInkSheetModel)sheet).CurrentDrawingAttributes; } } else if (sheet is InkSheetModel) { newModel = sheet; } else if (sheet is TextSheetModel) { newModel = sheet; } else if (sheet is QuickPollSheetModel) { newModel = sheet; } else if (sheet is XPSPageSheetModel) { newModel = sheet; } return(SheetMessage.ForSheet(newModel, collection)); }
public SheetMessage(Message parent, SerializedPacket p) : base(parent, p) { this.SheetCollectionSelector = (SheetCollection)SerializedPacket.DeserializeLong(p.GetNextPart()); this.Disposition = (SheetDisposition)SerializedPacket.DeserializeLong(p.GetNextPart()); this.Bounds = SerializedPacket.DeserializeRectangle(p.GetNextPart()); this.Height = SerializedPacket.DeserializeInt(p.GetNextPart()); }
public SheetMessage( Message parent, SerializedPacket p ) : base(parent, p) { this.SheetCollectionSelector = (SheetCollection)SerializedPacket.DeserializeLong( p.GetNextPart() ); this.Disposition = (SheetDisposition)SerializedPacket.DeserializeLong( p.GetNextPart() ); this.Bounds = SerializedPacket.DeserializeRectangle( p.GetNextPart() ); this.Height = SerializedPacket.DeserializeInt( p.GetNextPart() ); }
public TextSheetMessage(TextSheetModel sheet, SheetCollection collection) : base(sheet, collection) { using (Synchronizer.Lock(sheet.SyncRoot)) { this.Text = sheet.Text; this.font_ = sheet.Font; this.color_ = sheet.Color; this.is_public_ = sheet.IsPublic; } }
private void Refresh(object obj) { var l = new List <Sheet>(); SheetCollection.ToList().ForEach(x => l.Add(x)); SheetCollection.Clear(); l.ToList().ForEach(x => SheetCollection.Add(x)); RaisePropertyChanged("SheetCollection"); }
public SheetMessage(SheetModel sheet, SheetCollection collection) : base(sheet.Id) { this.AddLocalRef(sheet); this.Disposition = sheet.Disposition; this.SheetCollectionSelector = collection; using (Synchronizer.Lock(sheet.SyncRoot)) { this.Bounds = sheet.Bounds; } this.Height = sheet.Height; }
public SheetMessage(SheetModel sheet, SheetCollection collection) : base(sheet.Id) { this.AddLocalRef( sheet ); this.Disposition = sheet.Disposition; this.SheetCollectionSelector = collection; using(Synchronizer.Lock(sheet.SyncRoot)) { this.Bounds = sheet.Bounds; } this.Height = sheet.Height; }
public TextSheetMessage(TextSheetModel sheet, SheetCollection collection) : base(sheet, collection) { using(Synchronizer.Lock(sheet.SyncRoot)) { this.Text = sheet.Text; this.font_ = sheet.Font; this.color_ = sheet.Color; this.is_public_ = sheet.IsPublic; } }
public XPSPageSheetMessage(XPSPageSheetModel sheet, SheetCollection collection) : base(sheet, collection) { if (sheet.DocumentPageWrapper!=null) { using (Synchronizer.Lock(sheet.SyncRoot)) { this.m_DocumentPageWrapper = sheet.DocumentPageWrapper; this.Height = sheet.Height; this.Width = sheet.Width; } } }
public XPSPageSheetMessage(XPSPageSheetModel sheet, SheetCollection collection) : base(sheet, collection) { if (sheet.DocumentPageWrapper != null) { using (Synchronizer.Lock(sheet.SyncRoot)) { this.m_DocumentPageWrapper = sheet.DocumentPageWrapper; this.Height = sheet.Height; this.Width = sheet.Width; } } }
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; }
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; }
public ImageSheetMessage(ImageSheetModel sheet, SheetCollection collection) : base(sheet, collection) { if (sheet.Deck != null) { // we are in background mode // MD5 is not a Published property of ImageSheetModel. using (Synchronizer.Lock(sheet.SyncRoot)) { this.MD5 = sheet.MD5; } // Do NOT try to serialize the ImageContent. That is done by a separate DeckSlideContentMessage. } else { // we are in ImageIt mode using (Synchronizer.Lock(sheet.SyncRoot)) { this.image_ = sheet.Image; } } }
public static Message ForSheet(SheetModel sheet, SheetCollection collection) { if (sheet is ImageSheetModel) { //If it's an instructor note, return null. if (sheet.Disposition == SheetDisposition.Instructor) { return(null); } else { return(new ImageSheetMessage((ImageSheetModel)sheet, collection)); } } if (sheet is RealTimeInkSheetModel) { return(new RealTimeInkSheetInformationMessage((RealTimeInkSheetModel)sheet, collection)); } if (sheet is InkSheetModel) { return(new InkSheetInformationMessage((InkSheetModel)sheet, collection)); } if (sheet is TextSheetModel) { return(new TextSheetMessage((TextSheetModel)sheet, collection)); } if (sheet is QuickPollSheetModel) { Message poll; using (Synchronizer.Lock(sheet.SyncRoot)) { poll = new QuickPollInformationMessage(((QuickPollSheetModel)sheet).QuickPoll); } poll.InsertChild(new QuickPollSheetMessage((QuickPollSheetModel)sheet, collection)); return(poll); } if (sheet is XPSPageSheetModel) { return(new XPSPageSheetMessage((XPSPageSheetModel)sheet, collection)); } throw new ArgumentException("Unknown sheet type: " + sheet.GetType().ToString()); }
public InkSheetStrokesDeletingMessage(InkSheetModel sheet, SheetCollection selector, string[] strokeIds) : base(sheet, selector) { this.StrokeIds = ((string[])strokeIds.Clone()); }
public SheetRemovedMessage(SheetModel sheet, SheetCollection collection) : base(sheet, collection) { }
public static Message RemoteForSheet( SheetModel sheet, SheetCollection collection) { SheetModel newModel = null; if( sheet is ImageSheetModel ) newModel = sheet; else if( sheet is RealTimeInkSheetModel ) { using( Synchronizer.Lock( sheet.SyncRoot ) ) { newModel = new RealTimeInkSheetModel( sheet.Id, sheet.Disposition | SheetDisposition.Remote, sheet.Bounds ); using( Synchronizer.Lock( newModel.SyncRoot ) ) ((RealTimeInkSheetModel)newModel).CurrentDrawingAttributes = ((RealTimeInkSheetModel)sheet).CurrentDrawingAttributes; } } else if( sheet is InkSheetModel ) newModel = sheet; else if( sheet is TextSheetModel ) newModel = sheet; else if( sheet is QuickPollSheetModel ) newModel = sheet; return SheetMessage.ForSheet( newModel, collection ); }
public Workbook() { Sheets = new SheetCollection(); DefaultFont = new CellFont(); DefinedNames = new DefinedNameCollection(); }
public InkSheetStrokesAddedMessage(InkSheetModel sheet, Guid slideId, SheetCollection selector, Ink ink) : base(sheet, selector) { this.SavedInks = new byte[][] { ink.Save() }; SlideId = slideId; }
public InkSheetMessage(InkSheetModel sheet, SheetCollection selector) : base(sheet, selector) { }
public InkSheetStrokesDeletingMessage(InkSheetModel sheet, SheetCollection selector, string[] strokeIds) : base(sheet, selector) { this.StrokeIds = ((string[]) strokeIds.Clone()); }
public Workbook() { Sheets = new SheetCollection(); }
public InkSheetInformationMessage(InkSheetModel sheet, SheetCollection selector) : base(sheet, selector) { }