public LinkedDeckTraversalModel(EventQueue dispatcher, Guid id, PresenterModel model, DeckTraversalModel linked)
            : base(id, linked.Deck)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Linked = linked;
            // TODO: Evaluate whether we need to support other types of DeckTraversalModels.
            this.m_Unlinked = new SlideDeckTraversalModel(Guid.NewGuid(), linked.Deck);

            this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentChanged));
            this.m_NextChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNextChanged));
            this.m_PreviousChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandlePreviousChanged));
            this.m_AbsoluteCurrentSlideIndexChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleAbsoluteCurrentSlideIndexChanged));

            // Set this.m_Active and register event listeners via UpdateMode.
            this.m_Mode = DeckTraversalSelector.Linked;
            this.UpdateMode(DeckTraversalSelector.Linked);

            // Since UpdateMode doesn't initialize the event listeners like the Mode setter does, we must do this.
            this.m_CurrentChangedDispatcher.Dispatcher(this, null);
            this.m_NextChangedDispatcher.Dispatcher(this, null);
            this.m_PreviousChangedDispatcher.Dispatcher(this, null);
            this.m_AbsoluteCurrentSlideIndexChangedDispatcher.Dispatcher(this, null);

            // Watch for changes to the current network association.
            // When we're associated with an Instructor, we must obey its ForcingStudentNavigationLock policy.
            this.m_NetworkAssociationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationChanged));
            this.m_NetworkAssociationRoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationRoleChanged));
            this.m_ForcingStudentNavigationLockChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleForcingStudentNavigationLockChanged));
            this.m_Model.Network.Changed["Association"].Add(this.m_NetworkAssociationChangedDispatcher.Dispatcher);
            this.m_NetworkAssociationChangedDispatcher.Dispatcher(this, null);
        }
 /// <summary>
 /// Creates a new <see cref="PropertyPublisher"/> instance.
 /// </summary>
 /// <remarks>
 /// Subclasses must call <see cref="Initialize"/> in order to register event listeners and
 /// set up existing members of the collection.
 /// </remarks>
 /// <param name="owner">The <see cref="PropertyPublisher"/> to whom the collection belongs; see <see cref="Owner"/>.</param>
 /// <param name="property">The name of the published property of the <see cref="Owner"/> which returns the <see cref="Collection"/>.</param>
 public PropertyCollectionHelper(EventQueue dispatcher, PropertyPublisher owner, string property)
 {
     this.m_EventQueue = dispatcher;
     this.m_Owner = owner;
     this.m_Property = property;
     this.m_TagTable = Hashtable.Synchronized(new Hashtable());
 }
        /// <summary>
        /// Constructs a TableOfContentMatch to marshal changes from one table of
        /// contents to the other
        /// </summary>
        /// <param name="sender">The event quene for async calls</param>
        /// <param name="srcDeck">The source deck</param>
        /// <param name="destDeck">The dest deck</param>
        public TableOfContentsMatch( EventQueue sender, DeckModel srcDeck, DeckModel destDeck )
        {
            this.m_Sender = sender;
            this.m_SrcDeck = srcDeck;
            this.m_DestDeck = destDeck;

            this.m_SourceEntriesCollectionHelper = new EntriesCollectionHelper( this );
        }
Exemple #4
0
        /// <summary>
        /// Construct the sheet model
        /// </summary>
        /// <param name="sender">The event queue for async event handling</param>
        /// <param name="srcSheet">The source sheet model</param>
        /// <param name="dstSheet">The destination sheet model</param>
        /// <param name="selector">Unknown</param>
        public SheetMatch( EventQueue sender, SheetModel srcSheet, SheetModel dstSheet/*, SheetMessage.SheetCollection selector*/ )
        {
            this.m_Sender = sender;
            this.m_SourceSheet = srcSheet;
            this.m_DestSheet = dstSheet;

            this.m_BoundsChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleBoundsChanged));
            this.m_SourceSheet.Changed["Bounds"].Add(this.m_BoundsChangedDispatcher.Dispatcher);
        }
        public InkSheetMatch(EventQueue sender, InkSheetModel srcSheet, InkSheetModel dstSheet)
            : base(sender, srcSheet, dstSheet)
        {
            this.m_SourceSheet = srcSheet;
            this.m_DestSheet = dstSheet;

            this.m_SourceSheet.InkAdded += new StrokesEventHandler(this.HandleInkAdded);
            this.m_SourceSheet.InkDeleting += new StrokesEventHandler(this.HandleInkDeleting);

            this.SendExistingInk();
        }
        public TextSheetUndoService(EventQueue dispatcher, UndoModel undo, DeckModel deck, SlideModel slide, TextSheetModel sheet)
            : base(undo, deck, slide, sheet)
        {
            this.m_EventQueue = dispatcher;
            this.m_SheetChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleSheetChanged));

            //Ignore any sheets with the Remote flag
            if ((sheet.Disposition & SheetDisposition.Remote) == 0) {
                this.Sheet.Changed["Text"].Add(this.m_SheetChangedDispatcher.Dispatcher);
                this.Sheet.Changed["Font"].Add(this.m_SheetChangedDispatcher.Dispatcher);
            }
        }
        public PreviewTraversalModelAdapter(ControlEventQueue dispatcher, SlideViewer viewer, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Viewer = viewer;

            this.m_CurrentSlidePreviewDeckTraversalChangedDispatcher =
                this.m_Model.Workspace.CurrentSlidePreviewDeckTraversal.ListenAndInitialize(dispatcher,
                delegate(Property<DeckTraversalModel>.EventArgs args) {
                    this.CurrentSlidePreviewDeckTraversal = args.New;
                });
        }
        public DeckUndoService(EventQueue dispatcher, UndoModel undo, DeckModel deck)
        {
            this.m_EventQueue = dispatcher;
            this.m_Undo = undo;
            this.m_Deck = deck;

            this.m_DeckChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleDeckChanged));
            this.m_Deck.Changed["HumanName"].Add(this.m_DeckChangedDispatcher.Dispatcher);
            this.m_Deck.TableOfContents.Changed["Entries"].Add(this.m_DeckChangedDispatcher.Dispatcher);

            this.m_EntriesCollectionHelper = new EntriesCollectionHelper(this);
        }
        public NetworkAssociationService(EventQueue dispatcher, PresenterModel model)
        {
            this.m_Model = model;

            this.m_EventQueue = dispatcher;
            this.m_AssociationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleAssociationChanged));
            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleRoleChanged));
            this.m_CurrentPresentationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentPresentationChanged));
            this.m_CurrentDeckTraversalChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentDeckTraversalChanged));

            this.m_Model.Network.Changed["Association"].Add(this.m_AssociationChangedDispatcher.Dispatcher);
            this.m_AssociationChangedDispatcher.Dispatcher(this, null);
        }
        public InkSheetUndoService(EventQueue dispatcher, UndoModel undo, DeckModel deck, SlideModel slide, InkSheetModel sheet)
            : base(undo, deck, slide, sheet)
        {
            this.m_EventQueue = dispatcher;
            this.m_InkSheet = sheet;

            this.m_Ignore = new ArrayList();

            //Ignore any sheets with the Remote flag
            if ((this.m_InkSheet.Disposition & SheetDisposition.Remote) == 0) {
                this.m_HandleInkChangedDelegate = new HandleInkChangedDelegate(this.HandleInkChanged);
                this.m_InkSheet.InkAdded += new StrokesEventHandler(this.HandleInkAdded);
                this.m_InkSheet.InkDeleting += new StrokesEventHandler(this.HandleInkDeleting);
            }
        }
        public DeckTraversalModelAdapter(EventQueue dispatcher, IAdaptee viewer, DeckTraversalModel traversal)
        {
            this.m_EventQueue = dispatcher;
            this.m_DeckTraversal = traversal;
            this.m_Viewer = viewer;

            this.m_CurrentEntryChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentEntryChanged));
            this.m_DeckBGColorChangedDispatcher = new EventQueue.PropertyEventDispatcher( this.m_EventQueue, new PropertyEventHandler( this.HandleDeckBGColorChanged ) );
            this.m_DeckTraversal.Changed["Current"].Add( this.m_CurrentEntryChangedDispatcher.Dispatcher );
            using (Synchronizer.Lock(this.m_DeckTraversal.Deck.SyncRoot)) {
                this.m_DeckTraversal.Deck.Changed["DeckBackgroundColor"].Add( this.m_DeckBGColorChangedDispatcher.Dispatcher );
            }

            this.m_CurrentEntryChangedDispatcher.Dispatcher(this.m_DeckTraversal, null);
            this.m_CurrentEntryChangedDispatcher.Dispatcher(this.m_DeckTraversal, null);
        }
        public SlideUndoService(EventQueue dispatcher, UndoModel undo, DeckModel deck, SlideModel slide)
        {
            this.m_EventQueue = dispatcher;
            this.m_Undo = undo;
            this.m_Deck = deck;
            this.m_Slide = slide;

            this.m_SlideChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleSlideChanged));
            this.m_Slide.Changed["Title"].Add(this.m_SlideChangedDispatcher.Dispatcher);
            this.m_Slide.Changed["Bounds"].Add(this.m_SlideChangedDispatcher.Dispatcher);
            this.m_Slide.Changed["ContentSheets"].Add(this.m_SlideChangedDispatcher.Dispatcher);
            this.m_Slide.Changed["AnnotationSheets"].Add(this.m_SlideChangedDispatcher.Dispatcher);

            this.m_ContentSheetsCollectionHelper = new SheetsCollectionHelper(this, "ContentSheets");
            this.m_AnnotationSheetsCollectionHelper = new SheetsCollectionHelper(this, "AnnotationSheets");
        }
        /// <summary>
        /// Create the matching between two real time ink sheets
        /// </summary>
        /// <param name="sender">The event queue to invoke async events on</param>
        /// <param name="srcSheet">The source sheet to marshal packets/events from</param>
        /// <param name="dstSheet">The destination sheet to marshal packets/events to</param>
        public RealTimeInkSheetMatch(EventQueue sender, RealTimeInkSheetModel srcSheet, RealTimeInkSheetModel dstSheet )
            : base(sender, srcSheet, dstSheet)
        {
            // Save the parameters
            this.m_SourceSheet = srcSheet;
            this.m_DestSheet = dstSheet;

            // Setup event handlers for the source sheet
            this.m_CurrentDrawingAttributesChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleCurrentDrawingAttributesChanged));
            this.m_SourceSheet.Changed["CurrentDrawingAttributes"].Add(this.m_CurrentDrawingAttributesChangedDispatcher.Dispatcher);
            this.m_SourceSheet.StylusUp += new RealTimeInkSheetModel.StylusUpEventHandler(this.HandleStylusUp);
            this.m_SourceSheet.Packets += new RealTimeInkSheetModel.PacketsEventHandler(this.HandlePackets);
            this.m_SourceSheet.StylusDown += new RealTimeInkSheetModel.StylusDownEventHandler(this.HandleStylusDown);

            // Setup the initial values for the Drawing Attributes
            this.m_Sender.Post(delegate() {
                this.m_CurrentDrawingAttributesChangedDispatcher.Dispatcher(this, null);
            });
        }
        public DecksMenu(ControlEventQueue dispatcher, PresenterModel model)
        {
            this.m_Model = model;

            this.Text = Strings.Decks;

            queue_ = dispatcher;

            using (Synchronizer.Lock(this.m_Model.Workspace.CurrentDeckTraversal.SyncRoot)) {
                this.current_deck_traversal_listener_ = this.m_Model.Workspace.CurrentDeckTraversal.ListenAndInitialize(queue_, delegate(Property<DeckTraversalModel>.EventArgs args) {
                    ///remove all the current slide menu items
                    for (int i = this.MenuItems.Count; --i >= 0; ) {
                        if ((this.MenuItems[i] is UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.InsertSlideMenuItem) ||
                            (this.MenuItems[i] is UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.InsertSlidesFromFileMenuItem) ||
                            (this.MenuItems[i] is UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.RemoveSlideMenuItem))

                            this.MenuItems.RemoveAt(i);
                    }

                    current_deck_ = args.New;

                    if (current_deck_ != null) {
                        ///add the new, fresh items with the correct deck on.
                        ///
                        this.MenuItems.Add(new UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.InsertSlideMenuItem(current_deck_, this.m_Model));
                        this.MenuItems.Add(new UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.InsertSlidesFromFileMenuItem(current_deck_, this.m_Model));
                        this.MenuItems.Add(new UW.ClassroomPresenter.Viewer.FilmStrips.FilmStripContextMenu.RemoveSlideMenuItem(current_deck_, this.m_Model));
                    }
                });
            }

            this.MenuItems.Add(new CreateBlankWhiteboardDeckMenuItem(this.m_Model));
            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.

            // Note: These used to be in the "Slides" menu (see Bug 988).
            this.MenuItems.Add(new SetDeckBkgColorMenuItem(model));
            this.MenuItems.Add(new SetSlideBkgColorMenuItem(model));
            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.

            //            this.MenuItems.Add(new DeckMatcherMenuItem(model));
            //            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.
        }
Exemple #15
0
 public static SheetMatch ForSheet(EventQueue sender, SheetModel src, SheetModel dst )
 {
     // FIXME: Create SheetNetworkService classes for sheets other than InkSheetModels.
     if(src is RealTimeInkSheetModel) {
         return new RealTimeInkSheetMatch(sender, (RealTimeInkSheetModel)src, (RealTimeInkSheetModel)dst);
     }
     else if(src is InkSheetModel) {
         return new InkSheetMatch(sender, (InkSheetModel)src, (InkSheetModel)dst);
     }
     else if(src is ImageSheetModel) {
         return null;
     }
     else if(src is TextSheetModel) {
         return null;
     } else if( src is QuickPollSheetModel ) {
         return null;
     } else {
         return null;
     }
 }
        /// <summary>
        /// Constructs a new <see cref="TouchGestureHandler"/> instance, which will
        /// keep track of the touch input and convert it into a gesture.
        /// </summary>
        public TouchGestureHandler(PresenterModel m, EventQueue q )
        {
            this.model = m;
            this.currentDeckTraversal = null;

            // Listen for model changes
            this.eventQueue = q;
            this.currentDeckTraversalDispatcher =
                this.model.Workspace.CurrentDeckTraversal.ListenAndInitialize(this.eventQueue,
                    delegate(Property<DeckTraversalModel>.EventArgs args) {
                        this.currentDeckTraversal = args.New;
                    });

            // Keep track of the various touch strokes
            this.collectedPacketsTable = new Dictionary<int, List<int>>();
            this.tabletPropertiesTable = new Dictionary<int, TabletPropertyDescriptionCollection>();

            // Create a helper ink object
            this.ink = new Ink();
        }
Exemple #17
0
        /// <summary>
        /// Construct a slide match between two slides
        /// </summary>
        /// <param name="sender">The event queue for async calls</param>
        /// <param name="srcSlide">The source slide</param>
        /// <param name="destSlide">The destination slide</param>
        public SlideMatch( EventQueue sender, SlideModel srcSlide, SlideModel destSlide )
        {
            this.m_Sender = sender;
            this.m_SrcSlide = srcSlide;
            this.m_DestSlide = destSlide;

            // Listen for changes
            this.m_ChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleChange));
            this.m_Sender.Post(delegate() {
                this.m_ChangeDispatcher.Dispatcher(this, null);
            });
            this.m_SrcSlide.Changed["Bounds"].Add(this.m_ChangeDispatcher.Dispatcher);
            this.m_SrcSlide.Changed["Zoom"].Add(this.m_ChangeDispatcher.Dispatcher);
            this.m_SrcSlide.Changed["SubmissionSlideGuid"].Add( this.m_ChangeDispatcher.Dispatcher );
            this.m_SrcSlide.Changed["SubmissionStyle"].Add( this.m_ChangeDispatcher.Dispatcher );

            // Listen for changes to the sheets
            // NOTE: Content sheets cannot change, so we don't need to listen to changes in them
            // this.m_ContentSheetsCollectionHelper = new SheetsCollectionHelper(this, "ContentSheets");
            this.m_AnnotationSheetsCollectionHelper = new SheetsCollectionHelper(this, "AnnotationSheets");
        }
Exemple #18
0
        /// <summary>
        /// Creates a matching between the two decks and recursively creates matchings amongst all
        /// child objects
        /// </summary>
        /// <param name="sender">The EventQueue to invoke async things on</param>
        /// <param name="srcDeck">The deck to marshal changes from</param>
        /// <param name="destDeck">The deck to marshal changes to</param>
        public DeckMatch( EventQueue sender, DeckModel srcDeck, DeckModel destDeck )
        {
            this.m_Sender = sender;
            this.m_SrcDeck = srcDeck;
            this.m_DestDeck = destDeck;

            this.m_SlideMatches = new ArrayList();
            this.m_TableOfContentsMatch = new TableOfContentsMatch( this.m_Sender, this.m_SrcDeck, this.m_DestDeck );

            this.SetupInitialMappings();

            this.m_SlideRemovedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideRemoved));
            this.m_SlideAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideAdded));
            this.m_SlideContentAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideContentAdded));

            // Lock the deck so no content can be added between registering the event listeners.
            using(Synchronizer.Lock(this.m_SrcDeck.SyncRoot)) {
                this.m_SrcDeck.SlideRemoved += this.m_SlideRemovedDispatcher.Dispatcher;
                this.m_SrcDeck.SlideAdded += this.m_SlideAddedDispatcher.Dispatcher;
                this.m_SrcDeck.SlideContentAdded += this.m_SlideContentAddedDispatcher.Dispatcher;
            }
        }
        /// <summary>
        /// Constructs a new matching between the two given DeckTraversalModels
        /// </summary>
        /// <param name="srcTraversal">The DeckTraversal to marshal changes from</param>
        /// <param name="destTraversal">The DeckTraversal to marshal changes to</param>
        public DeckTraversalMatch( EventQueue sender, DeckTraversalModel srcTraversal, DeckTraversalModel destTraversal )
        {
            // Set the members
            this.m_Sender = sender;
            this.m_SourceDeckTraversal = srcTraversal;
            this.m_DestDeckTraversal = destTraversal;

            this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleCurrentChanged));

            if( !this.IsSameTarget() ) {
                // Recursively Create all the child matchings
                this.m_DeckMatch = new DeckMatch( this.m_Sender, this.m_SourceDeckTraversal.Deck, this.m_DestDeckTraversal.Deck );

                // Setup the listeners
                this.m_SourceDeckTraversal.Changed["Current"].Add(this.m_CurrentChangedDispatcher.Dispatcher);

                // Update the initial values
                this.m_Sender.Post(delegate() {
                    this.m_CurrentChangedDispatcher.Dispatcher(this, null);
                });
            }
        }
            /// <summary>
            /// Constructor
            /// </summary>
            /// <param name="dispatcher">The event queue</param>
            /// <param name="model">The model</param>
            public UndoRedoToolBarButton(EventQueue dispatcher, PresenterModel model)
            {
                this.m_EventQueue = dispatcher;
                this.m_Model = model;

                // TODO: Dynamically change the ToolTipText depending on what type of change will be undone.
                this.ToolTipText = Strings.UndoTooltipText;

                this.m_Model.Undo.Update += new EventHandler(this.HandleUndoableChanged);
                this.m_WorkspaceModelAdapter = new WorkspaceModelAdapter(dispatcher, this, this.m_Model);
            }
Exemple #21
0
 public IDisposable Listen(EventQueue dispatcher, RemovedEventHandler handler)
 {
     // The RemovedEventDispatcher constructor adds an event handler to the Removed event.
     return(new RemovedEventDispatcher(this, dispatcher, handler));
 }
        public WorkspaceModelAdapter(EventQueue dispatcher, DeckTraversalModelAdapter.IAdaptee viewer, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Viewer = viewer;
            this.m_DeckBGColorChangedDispatcher = new EventQueue.PropertyEventDispatcher( dispatcher, new PropertyEventHandler( this.HandleBackgroundColorChanged ) );
            this.m_DeckBGTemplateChangedDispatcher = new EventQueue.PropertyEventDispatcher(dispatcher, new PropertyEventHandler(this.HandleBackgroundTemplateChanged));

            this.m_CurrentDeckTraversalChangedDispatcher =
                this.m_Model.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher,
                delegate(Property<DeckTraversalModel>.EventArgs args) {
                    if (this.CurrentDeckTraversal != null)
                        using (Synchronizer.Lock(this.CurrentDeckTraversal.SyncRoot))
                        using (Synchronizer.Lock(this.CurrentDeckTraversal.Deck.SyncRoot)){
                            this.CurrentDeckTraversal.Deck.Changed["DeckBackgroundColor"].Remove( this.m_DeckBGColorChangedDispatcher.Dispatcher );
                            this.CurrentDeckTraversal.Deck.Changed["DeckBackgroundTemplate"].Remove(this.m_DeckBGTemplateChangedDispatcher.Dispatcher);
                        }

                    this.CurrentDeckTraversal = args.New;

                    if (this.CurrentDeckTraversal != null) {
                        using (Synchronizer.Lock(this.CurrentDeckTraversal.SyncRoot))
                        using (Synchronizer.Lock(this.CurrentDeckTraversal.Deck.SyncRoot)) {
                            this.CurrentDeckTraversal.Deck.Changed["DeckBackgroundColor"].Add(this.m_DeckBGColorChangedDispatcher.Dispatcher);
                            this.CurrentDeckTraversal.Deck.Changed["DeckBackgroundTemplate"].Add(this.m_DeckBGTemplateChangedDispatcher.Dispatcher);
                        }
                        this.HandleBackgroundColorChanged(this, null);
                        this.HandleBackgroundTemplateChanged(this, null);
                    }
                });
        }
            public ClassroomMenuItem(ControlEventQueue dispatcher, PresenterModel model, ClassroomModel classroom)
            {
                this.m_EventQueue = dispatcher;
                this.m_Model = model;
                this.m_Classroom = classroom;

                this.m_HumanNameChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleHumanNameChanged));
                this.m_ConnectedChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleConnectedChanged));

                this.m_Classroom.Changed["HumanName"].Add(this.m_HumanNameChangedDispatcher.Dispatcher);
                this.m_Classroom.Changed["Connected"].Add(this.m_ConnectedChangedDispatcher.Dispatcher);

                this.m_HumanNameChangedDispatcher.Dispatcher(this, null);
                this.m_ConnectedChangedDispatcher.Dispatcher(this, null);
            }
 public ImageSheetUndoService(EventQueue dispatcher, UndoModel undo, DeckModel deck, SlideModel slide, ImageSheetModel sheet)
     : base(undo, deck, slide, sheet)
 {
     // There are currently no published properties of ImageSheetModel, other than those handled by the base class.
 }
            public UndoMenuItem(ControlEventQueue dispatcher, PresenterModel model)
            {
                this.m_Model = model;
                this.m_EventQueue = dispatcher;

                this.Text = Strings.Undo;
                this.Shortcut = Shortcut.CtrlZ;
                this.ShowShortcut = true;

                this.m_Model.Undo.Update += new EventHandler(this.HandleUndoableChanged);
                this.m_WorkspaceModelAdapter = new WorkspaceModelAdapter(dispatcher, this, this.m_Model);
            }
Exemple #26
0
 /// <summary>
 /// Creates a new <see cref="CollectionMirror"/> that monitors the given collection.
 /// </summary>
 /// <param name="dispatcher">
 /// The <see cref="EventQueue"/> to which calls to <see cref="SetUp"/>
 /// and <see cref="TearDown"/> will be serialized.
 /// </param>
 /// <param name="collection">
 /// The collection to monitor.
 /// </param>
 public CollectionMirror(EventQueue dispatcher, Collection <V> collection)
 {
     this.q = dispatcher;
     this.c = collection;
     this.t = new Dictionary <V, T>();
 }
Exemple #27
0
 /// <summary>
 /// Creates a new <see cref="Delegator"/> instance which invokes
 /// the given delegate when <see cref="SetUp"/> is called, and which
 /// invokes the default <see cref="CollectionMirror.TearDown"/> method.
 /// </summary>
 /// <param name="setup">
 /// The delegate to invoke when <see cref="SetUp"/> is called.
 /// </param>
 public Delegator(EventQueue dispatcher, Collection <V> collection, SetUpDelegate s)
     : this(dispatcher, collection, s, null)
 {
 }
Exemple #28
0
 public PropertyMirror(EventQueue dispatcher, Property <V> property)
     : this(dispatcher, property, default(T))
 {
 }
Exemple #29
0
 public Delegator(EventQueue dispatcher, Property <V> property, T tag, ChangedDelegate changed)
     : base(dispatcher, property, tag)
 {
     this.c = changed;
 }
Exemple #30
0
 public PropertyMirror(EventQueue dispatcher, Property <V> property, T tag)
 {
     this.q = dispatcher;
     this.p = property;
     this.t = tag;
 }
Exemple #31
0
 /// <summary>
 /// Creates a new <see cref="PropertyEventDispatcher"/>.
 /// </summary>
 /// <param name="queue">
 /// The <see cref="EventQueue"/> to which the <see cref="Dispatcher"/>
 /// will redirect events.
 /// </param>
 /// <param name="handler">
 /// The <see cref="PropertyEventHandler"/> to be executed on the <see cref="EventQueue"/>
 /// each time the <see cref="Dispatcher"/> is invoked.
 /// </param>
 public PropertyEventDispatcher(EventQueue queue, PropertyEventHandler handler)
 {
     this.m_Queue = queue;
     this.m_Handler = handler;
     this.m_Dispatcher = new PropertyEventHandler(this.HandlePropertyEvent);
 }
Exemple #32
0
 /// <summary>
 /// Creates a new <see cref="PropertyEventDispatcher"/>.
 /// </summary>
 /// <param name="queue">
 /// The <see cref="EventQueue"/> to which the <see cref="Dispatcher"/>
 /// will redirect events.
 /// </param>
 /// <param name="handler">
 /// The <see cref="PropertyEventHandler"/> to be executed on the <see cref="EventQueue"/>
 /// each time the <see cref="Dispatcher"/> is invoked.
 /// </param>
 public PropertyEventDispatcher(EventQueue queue, PropertyEventHandler handler)
 {
     this.m_Queue      = queue;
     this.m_Handler    = handler;
     this.m_Dispatcher = new PropertyEventHandler(this.HandlePropertyEvent);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dispatcher">The event queue</param>
 /// <param name="model">The model</param>
 public UndoToolBarButton( EventQueue dispatcher, PresenterModel model )
     : base(dispatcher, model)
 {
     // TODO: Dynamically change the ToolTipText depending on what type of change will be redone.
     this.ToolTipText = Strings.UndoTooltipText;
 }
        /// <summary>
        /// Creates a new <see cref="ViewerPresentationLayout"/> instance and instantiates all of the child controls.
        /// </summary>
        /// <param name="model">The model whose <see cref="WorkspaceModel.CurrentDeckTraversal"/> property will
        /// be used to display the current slide and deck.</param>
        public ViewerPresentationLayout(PresenterModel model)
        {
            this.Name = "ViewerPresentationLayout";
            this.m_Model = model;

            this.m_EventQueue = new ControlEventQueue(this);

            m_Model.Workspace.CurrentDeckTraversal.ListenAndInitialize(m_EventQueue, new Property<DeckTraversalModel>.EventHandler(this.HandleTraversalChanged));

            // Create the film strip, docked to the right side of the container.
            this.m_DeckStrip = new DeckStrip(this.m_Model);
            /// Filmstrip docking
            this.m_DeckStrip.Dock = DockStyle.Right;

            // Make the deck strip resizable with a LinkedSplitter.
            // The splitter automatically sets its dock to be the same as the FilmStrip.
            this.m_DeckStripSplitter = new LinkedSplitter(this.m_DeckStrip);

            // Create the MainSlideViewer, which occupies the remaining space in the container.
            this.m_MainSlideViewer = new MainSlideViewer(this.m_Model, true);
            this.m_MainSlideViewer.Dock = DockStyle.Fill;

            #region RealTimeStylus Initialization
            // Create a new RealTimeStylus, which will process ink drawn on the MainSlideViewer.
            this.m_RealTimeStylus = new RealTimeStylus(this.m_MainSlideViewer, true);

            // Make sure the TransformableDynamicRenderer and InkAnnotationCollector
            // find out whenever the current StylusModel changes.
            this.m_StylusInputSelector = new StylusInputSelector(this.m_Model, this.m_RealTimeStylus);
            this.m_RealTimeStylus.SyncPluginCollection.Add(this.m_StylusInputSelector);

            // Scale the ink to the inverse of the MainSlideViewer's transform.
            // This keeps the ink's coordinates correct when the MainSlideViewer's transform
            // is applied again later by the TransformableDynamicRenderer and InkAnnotationCollector.
            this.m_InkTransformFilter = new InkTransformFilter(this.m_MainSlideViewer.SlideDisplay);
            this.m_RealTimeStylus.SyncPluginCollection.Add(this.m_InkTransformFilter);

            // Create a *synchronous* TransformableDynamicRenderer, which will render ink received directly
            // from the RealTimeStylus on a high-priority thread.
            this.m_TransformableDynamicRenderer = new TransformableDynamicRendererLinkedToDisplay(this.m_MainSlideViewer, this.m_MainSlideViewer.SlideDisplay);
            this.m_TransformableDynamicRenderer.Enabled = true;
            this.m_RealTimeStylus.SyncPluginCollection.Add(this.m_TransformableDynamicRenderer);

            // Don't dynamically render ink on the main slide viewer twice.  The MainSlideViewer's RealTimeInkSheetRenderer's
            // own TransformableDynamicRenderer would render the ink on a low-priority asynchronous thread, which is
            // fine for secondary slide viewers and the FilmStrip, but not fine for the MainSlideViewer.
            using (Synchronizer.Lock(this.m_MainSlideViewer.SlideDisplay.SyncRoot)) {
                this.m_MainSlideViewer.SlideDisplay.RenderLocalRealTimeInk = false;
            }

            // Create an InkAnnotationCollector and wrap it in an InkSheetAdapter,
            // which sends ink from the RealTimeStylus to the RealTimeInkSheetModel
            // of the MainSlideViewer's current slide.
            this.m_InkAnnotationCollector = new InkAnnotationCollector();
            this.m_InkAnnotationCollector_InkSheetAdapter = new InkSheetAdapter(this.m_MainSlideViewer.SlideDisplay, this.m_InkAnnotationCollector);
            this.m_RealTimeStylus.AsyncPluginCollection.Add(this.m_InkAnnotationCollector);

            this.m_LassoPlugin = new LassoPlugin(this.m_MainSlideViewer, this.m_MainSlideViewer.SlideDisplay);
            this.m_LassoPlugin_InkSheetAdapter = new InkSheetAdapter(this.m_MainSlideViewer.SlideDisplay, this.m_LassoPlugin);
            this.m_RealTimeStylus.SyncPluginCollection.Add(this.m_LassoPlugin);

            this.m_EraserPlugin = new EraserPlugin(this.m_MainSlideViewer.SlideDisplay);
            this.m_EraserPlugin_InkSheetAdapter = new InkSheetAdapter(this.m_MainSlideViewer.SlideDisplay, this.m_EraserPlugin);
            this.m_RealTimeStylus.SyncPluginCollection.Add(this.m_EraserPlugin);

            // Now that all the plugins have been added, enable the RealTimeStylus.
            this.m_RealTimeStylus.Enabled = true;
            #endregion RealTimeStylus Initialization

            // Create a DeckTraversalModelAdapter, which causes the MainSlideViewer to always display the
            // current slide of the current deck of the PresenterModel's current DeckTraversalModel.
            this.m_WorkspaceModelAdapter = new WorkspaceModelAdapter(this.m_MainSlideViewer.SlideDisplay.EventQueue, this.m_MainSlideViewer, this.m_Model);

            // Create the Slide Preview control
            this.m_SlidePreview = new SlidePreview(this.m_Model, this.m_DeckStripSplitter);
            this.m_PreviewTraversalModelAdapter
                = new PreviewTraversalModelAdapter(this.m_SlidePreview.m_EventQueue, this.m_SlidePreview.m_PreviewSlideViewer, this.m_Model);

            // Create the Second Monitor Form, this displays the slide on the secondary display
            this.m_SecondMonitorForm = new SecondMonitorForm(this.m_Model);
            this.ParentChanged += new EventHandler(OnParentChanged);

            // Create the Role Synchronizer for the MainSlideViewer
            this.m_RoleSync = new RoleSynchronizer(this.m_MainSlideViewer, this.m_Model.Participant);

            #region Add Controls
            // Add the SlidePreview Control
            this.Controls.Add(this.m_SlidePreview);

            // Now, add the controls in reverse order of their docking priority.
            // The MainSlideViewer gets added first so its Fill dock-style will be effective.
            this.Controls.Add(this.m_MainSlideViewer);

            // Next, dock the FilmStripSplitter and the FilmStrip in reverse order,
            // so that the FilmStripSplitter will be farther away from the edge of the container.
            this.Controls.Add(this.m_DeckStripSplitter);
            this.Controls.Add(this.m_DeckStrip);

            #endregion Add Controls
        }
Exemple #35
0
 public Delegator(EventQueue dispatcher, Property <V> property, ChangedDelegate changed)
     : this(dispatcher, property, default(T), changed)
 {
 }
Exemple #36
0
 /// <summary>
 /// Creates a new <see cref="ModelMirror"/>.
 /// </summary>
 /// <param name="dispatcher">
 /// The <see cref="EventQueue"/> on which changes across all
 /// links are serialized.  It is presumed that such events will
 /// be executed by the <see cref="EventQueue"/> on the same thread.
 /// </param>
 public ModelMirror(EventQueue dispatcher)
 {
     this.q         = dispatcher;
     this.l         = new List <IDisposable>();
     this.m_Enabled = true;
 }