コード例 #1
0
        public ConnectTCPRadioButton(ControlEventQueue dispatcher, PresenterModel model, ManualConnectionPanel manual, Point location, int width)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Manual = manual;
            this.m_Connected = false;
            this.FlatStyle = FlatStyle.System;
            this.Font = Model.Viewer.ViewerStateModel.StringFont1;
            this.Text = Strings.ConnectToTCPServer;
            this.Location = location;
            this.Size = new Size(width, this.Font.Height + 5);
            this.m_ClassroomManager = null;

            //Watch for Role changes and disable if role is Instructor.
            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleRoleChanged));
            this.m_Model.Participant.Changed["Role"].Add(this.m_RoleChangedDispatcher.Dispatcher);
            using (Synchronizer.Lock(this.m_Model.Participant.SyncRoot)) {
                if (this.m_Model.Participant.Role is InstructorModel)
                    this.Enabled = false;
                else
                    this.Enabled = true;
            }

            //should probably make this a listener
            //Do persistence in a more intelligent way - this doesn't make the popup pop up.
            /*using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
                if (this.Text == this.m_Model.ViewerState.ManualConnectionButtonName) {
                    this.Checked = true;
                    }
                }*/

            this.CheckedChanged += new EventHandler(OnClick);

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
コード例 #2
0
        /// <summary>
        /// Subclasses must call this method in their constructor in order to set up event listeners
        /// and to invoke <see cref="SetUpMember"/> on each of the members already present in the
        /// collection when the <see cref="PropertyCollectionHelper"/> is initialized.
        /// </summary>
        /// <remarks>
        /// This method is not called by the base class constructor, in order to allow subclasses to perform
        /// any necessary initialization in their own constructors before calls to <see cref="SetUpMember"/> are made.
        /// </remarks>
        /// <exception cref="InvalidOperationException">
        /// If <see cref="Initialize"/> is called more than once.
        /// </exception>
        protected void Initialize()
        {
            // A lock is necessary in order to read the items from this.Collection,
            // and also to synchronize on the PropertyCollectionHelper instead of lock(this).
            // We can't use lock(this) because the lock ordering cannot be guaranteed.
            using (Synchronizer.Lock(this.m_Owner.SyncRoot)) {
                if (this.m_Initialized)
                {
                    throw new InvalidOperationException("The PropertyCollectionHelper has already been initialized.");
                }
                this.m_Initialized = true;

                // Set up event listeners.
                this.m_HandlePropertyChangingDispatch = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandlePropertyChanging));
                this.m_HandlePropertyChangedDispatch  = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandlePropertyChanged));

                // Call HandlePropertyChanged to set up each existing member in the collection.
                object            collection = this.Collection;
                PropertyEventArgs args       = new PropertyChangeEventArgs(this.Property, collection, collection);
                this.m_HandlePropertyChangedDispatch.Dispatcher(this.m_Owner, args);

                // Register the event listeners after setting up members so no member can get set up twice.
                // (Not really a ThreadStart, but we just need a no-args delegate type.)
                this.m_EventQueue.Post(delegate() {
                    using (Synchronizer.Lock(this.m_Owner.SyncRoot)) {
                        if (!this.m_Disposed)
                        {
                            this.m_Owner.Changing[this.Property].Add(this.m_HandlePropertyChangingDispatch.Dispatcher);
                            this.m_Owner.Changed[this.Property].Add(this.m_HandlePropertyChangedDispatch.Dispatcher);
                        }
                    }
                });
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public PresentationRadioButton(ControlEventQueue dispatcher, PresentationModel presentation, StartupForm stup, PresentationsPanel parent, int i, ClassroomModel classroom)
        {
            this.m_EventQueue = dispatcher;
            this.m_Presentation = presentation;
            this.Tag = presentation.Owner;
            this.m_Startup = stup;
            this.Parent = parent;
            this.m_PresentationsPanel = parent;
            this.m_Classroom = classroom;
            this.Parent.Controls.Add(this);

            this.FlatStyle = FlatStyle.System;
            this.Font = Model.Viewer.ViewerStateModel.StringFont1;
            this.index = i;

            this.Location = new Point(10, (2*this.Font.Height) * (this.index + 1));
            this.Size = new Size(this.Parent.Width - 14, 2*this.Font.Height);

            //If the role changes we should remove ourself from our parent.
            this.m_ViewerStateRoleListener = new EventQueue.PropertyEventDispatcher(this.m_Startup.m_EventQueue,
                    new PropertyEventHandler(this.HandleViewerStateRoleChanged));
            this.m_Startup.m_Model.ViewerState.Changed["iRole"].Add(this.m_ViewerStateRoleListener.Dispatcher);

            this.m_HumanNameChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleHumanNameChanged));
            this.Presentation.Changed["HumanName"].Add(this.m_HumanNameChangedDispatcher.Dispatcher);
            this.m_HumanNameChangedDispatcher.Dispatcher(this.Presentation, null);
            this.CheckedChanged += new EventHandler(HandlePresentationSelectionChanged);

            this.m_ConnectedChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleConnectedChanged));
            this.m_Classroom.Changed["Connected"].Add(this.m_ConnectedChangedDispatcher.Dispatcher);
            this.HandleConnectedChanged(this.m_Classroom, null);
        }
コード例 #5
0
        public StartJoinButton2(PresenterModel model, StartupForm stup, bool compact)
        {
            this.m_Model = model;
            this.m_Startup = stup;
            this.Text = text1;
            this.AutoSize = false;
            this.FlatStyle = FlatStyle.System;
            this.Font = Model.Viewer.ViewerStateModel.StringFont1;
            this.clicked = false;

            //Calculate the largest size for this button
            SizeF size1, size2;
            using (Graphics g = this.CreateGraphics()) {
                size1 = g.MeasureString(text1, this.Font);
                size2 = g.MeasureString(text2, this.Font);
                size1.Width += 15;
                size2.Width += 10;
                if (compact) {
                    size1.Height += 5;
                    size2.Height += 5;
                }
                else {
                    size1.Height += 10;
                    size2.Height += 15;
                }
            }
            this.Size = new Size(Math.Max((int)size1.Width, (int)size2.Width), Math.Max((int)size1.Height, (int)size2.Height));

            this.DialogResult = DialogResult.OK;

             this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Startup.m_EventQueue, new PropertyEventHandler(this.TextOnRoleChange));
             this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
             this.m_RoleChangedDispatcher.Dispatcher(null, null);
        }
コード例 #6
0
        /// <summary>
        /// Constructs a listener for changes to the deck traversal
        /// </summary>
        /// <param name="sender">The event queue for handling updates</param>
        /// <param name="presentation">The presentation</param>
        /// <param name="traversal">The deck traversal we care about </param>
        public DeckTraversalWebService(SendingQueue sender, PresentationModel presentation, DeckTraversalModel traversal)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_DeckTraversal = traversal;

            // Create the deck object
            string deckName = "Untitled Deck";
            using (Synchronizer.Lock(this.m_DeckTraversal.SyncRoot))
            {
                using (Synchronizer.Lock(this.m_DeckTraversal.Deck))
                {
                    deckName = this.m_DeckTraversal.Deck.HumanName;
                }
            }
            SimpleWebDeck deck = new SimpleWebDeck();
            deck.Name = deckName;
            lock (WebService.Instance.GlobalModel) {
                WebService.Instance.GlobalModel.Decks.Add(deck);
            }
            WebService.Instance.UpdateModel();

            this.m_DeckWebService = new DeckWebService(this.m_Sender, this.m_Presentation, this.m_DeckTraversal.Deck);

            this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleCurrentChanged));
            this.m_DeckTraversal.Changed["Current"].Add(this.m_CurrentChangedDispatcher.Dispatcher);
        }
コード例 #7
0
        public DeckNetworkService(SendingQueue sender, PresentationModel presentation, DeckModel deck)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_Deck = deck;

            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));
            this.m_DeckBackgroundColorChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleDeckBackgroundColorChanged));

            this.m_SlideNetworkServices = new Hashtable();

            this.m_TableOfContentsNetworkService = new TableOfContentsNetworkService(this.m_Sender, this.m_Presentation, this.m_Deck);

            // Lock the deck so no content can be added between registering the event listeners and calling SendAllSlidesAndContent().
            using( Synchronizer.Lock(this.m_Presentation.SyncRoot) ) {
                using(Synchronizer.Lock(deck.SyncRoot)) {

                    this.m_Deck.SlideRemoved += this.m_SlideRemovedDispatcher.Dispatcher;
                    this.m_Deck.SlideAdded += this.m_SlideAddedDispatcher.Dispatcher;
                    this.m_Deck.SlideContentAdded += this.m_SlideContentAddedDispatcher.Dispatcher;
                    this.m_Deck.Changed["DeckBackgroundColor"].Add(this.m_DeckBackgroundColorChangedDispatcher.Dispatcher);

                    this.SendAllSlidesAndContent(Group.AllParticipant);
                }
            }
        }
コード例 #8
0
ファイル: SheetMatch.cs プロジェクト: ClassroomPresenter/CP3
        /// <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);
        }
コード例 #9
0
        public InkSheetAdapter(SlideDisplayModel display, IAdaptee adaptee)
        {
            this.m_SlideDisplay = display;
            this.m_Adaptee = adaptee;

            this.m_SlideChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_SlideDisplay.EventQueue, new PropertyEventHandler(this.HandleSlideChanged));
            this.m_SlideDisplay.Changed["Slide"].Add(this.m_SlideChangedDispatcher.Dispatcher);
            this.m_SlideChangedDispatcher.Dispatcher(this.m_SlideDisplay, null);
        }
コード例 #10
0
        /// <summary>
        /// Constructor for the web service.
        /// </summary>
        /// <param name="sender">The event queue to use.</param>
        /// <param name="presentation">The web performance model to listen to.</param>
        public WebPerformanceWebService(SendingQueue sender, WebPerformanceModel performance)
        {
            this.m_Sender = sender;
            this.m_WebPerformance = performance;

            this.m_RequestSubmissionChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleRequestSubmissionChanged));
            this.m_WebPerformance.Changed["RequestSubmissionSignal"].Add(this.m_RequestSubmissionChangedDispatcher.Dispatcher);
            this.m_RequestLogChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleRequestLogChanged));
            this.m_WebPerformance.Changed["RequestLogSignal"].Add(this.m_RequestLogChangedDispatcher.Dispatcher);
        }
コード例 #11
0
        /// <summary>
        /// Construct a StudentPresentationNetworkService
        /// </summary>
        /// <param name="sender">The event queue to use</param>
        /// <param name="presentation">The PresentationModel to listen for changes to</param>
        public StudentPresentationNetworkService( SendingQueue sender, PresentationModel presentation )
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;

            this.m_StudentQuickPollNetworkService = new StudentQuickPollNetworkService( this.m_Sender, this.m_Presentation );

            this.m_StudentQuickPollChangedDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler( this.HandleStudentQuickPollChanged ) );
            this.m_Presentation.Changed["QuickPoll"].Add( this.m_StudentQuickPollChangedDispatcher.Dispatcher );
        }
コード例 #12
0
        /// <summary>
        /// Constructor for the scripting network service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="model"></param>
        /// <param name="diag"></param>
        public ScriptingNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.Sender = sender;
            this.m_Model = model;
            this.m_Diagnostic = model.ViewerState.Diagnostic;

            // Set up the change listeners
            this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleGenericChange));
            this.m_Diagnostic.Changed["ExecuteRemoteScript"].Add(this.m_GenericChangeDispatcher.Dispatcher);
        }
コード例 #13
0
        /// <summary>
        /// Construct the renderer
        /// </summary>
        /// <param name="display">The SlideDisplayModel</param>
        /// <param name="sheet">The QuickPollSheetModel</param>
        public QuickPollSheetRenderer( SlideDisplayModel display, QuickPollSheetModel sheet)
            : base(display, sheet)
        {
            this.m_Sheet = sheet;
            repaint_dispatcher_ = new EventQueue.PropertyEventDispatcher(SlideDisplay.EventQueue, this.Repaint);

            /// Add event listeners
            this.m_Sheet.QuickPoll.Changed["Updated"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
            this.SlideDisplay.Changed["Slide"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
        }
コード例 #14
0
            public DockMenuItem(ControlEventQueue dispatcher, PresenterModel model, DockStyle dock, string text)
                : base(text)
            {
                this.m_Model = model;
                this.m_DockStyle = dock;

                this.m_FilmStripAlignmentListener = new EventQueue.PropertyEventDispatcher(dispatcher,
                    new PropertyEventHandler(this.HandleFilmStripAlignmentChanged));
                this.m_Model.ViewerState.Changed["FilmStripAlignment"].Add(this.m_FilmStripAlignmentListener.Dispatcher);
                this.m_FilmStripAlignmentListener.Dispatcher(this, null);
            }
コード例 #15
0
        public DeckTraversalNetworkService(SendingQueue sender, PresentationModel presentation, DeckTraversalModel traversal)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_DeckTraversal = traversal;

            this.m_DeckNetworkService = new DeckNetworkService(this.m_Sender, this.m_Presentation, this.m_DeckTraversal.Deck);

            this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleCurrentChanged));
            this.m_DeckTraversal.Changed["Current"].Add(this.m_CurrentChangedDispatcher.Dispatcher);
        }
コード例 #16
0
        /// <summary>
        /// Constructs a new QuickPollResultNetworkService
        /// </summary>
        /// <param name="sender">The message queue to use</param>
        /// <param name="presentation">The PresentationModel to associate this service with</param>
        /// <param name="poll">The QuickPollModel to associate this service with</param>
        /// <param name="result">The QuickPollResultModel to associate this service with</param>
        public QuickPollResultNetworkService( SendingQueue sender, PresentationModel presentation, QuickPollModel poll, QuickPollResultModel result )
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_QuickPoll = poll;
            this.m_Result = result;

            // Listen to changes tot he ResultString
            this.m_ResultChangedDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler( this.HandleResultChanged ) );
            this.m_Result.Changed["ResultString"].Add( this.m_ResultChangedDispatcher.Dispatcher );
        }
コード例 #17
0
        public ParticipantNetworkService(SendingQueue sender, PresenterModel model, ParticipantModel participant)
        {
            this.m_Sender = sender;
            this.m_Model = model;
            this.m_Participant = participant;

            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleRoleChanged));
            this.m_Participant.Changed["Role"].Add(this.m_RoleChangedDispatcher.Dispatcher);
            this.m_RoleChangedDispatcher.Dispatcher(this, null);

            this.m_GroupCollectionHelper = new GroupCollectionHelper(this);
        }
コード例 #18
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dispatcher">The event queue</param>
        /// <param name="stylus">The stylus model</param>
        /// <param name="model">The presenter model</param>
        public StylusToolBarButton(ControlEventQueue dispatcher, StylusModel stylus, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Stylus = stylus;
            this.m_Model = model;

            this.m_StylusChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleStylusChanged));
            this.m_Model.Changed["Stylus"].Add(this.m_StylusChangedDispatcher.Dispatcher);

            // Initialize the Pushed state.
            this.m_StylusChangedDispatcher.Dispatcher(null, null);
        }
コード例 #19
0
        public SheetNetworkService(SendingQueue sender, PresentationModel presentation, DeckModel deck, SlideModel slide, SheetModel sheet, SheetMessage.SheetCollection selector)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_Deck = deck;
            this.m_Slide = slide;
            this.m_Sheet = sheet;
            this.m_Selector = selector;

            this.m_BoundsChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleBoundsChanged));
            this.m_Sheet.Changed["Bounds"].Add(this.m_BoundsChangedDispatcher.Dispatcher);
        }
コード例 #20
0
        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);
            }
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        public SlideRenderer(SlideDisplayModel display, string sheetsCollectionTag)
        {
            this.m_SlideDisplay = display;
            this.m_SheetsCollectionTag = sheetsCollectionTag;
            this.m_SheetRenderers = new SheetRenderersCollection();

            this.m_SlideChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_SlideDisplay.EventQueue, new PropertyEventHandler(this.HandleSlideChanged));
            this.m_SheetDispositionChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_SlideDisplay.EventQueue, new PropertyEventHandler(this.HandleSheetDispositionChanged));

            this.m_SlideDisplay.Changed["Slide"].Add(this.m_SlideChangedDispatcher.Dispatcher);
            this.m_SlideDisplay.Changed["SheetDisposition"].Add(this.m_SheetDispositionChangedDispatcher.Dispatcher);
        }
コード例 #23
0
        public TextSheetRenderer(SlideDisplayModel display, TextSheetModel sheet)
            : base(display, sheet)
        {
            this.m_Sheet = sheet;

            repaint_dispatcher_ = new EventQueue.PropertyEventDispatcher(SlideDisplay.EventQueue, this.Repaint);
            /// Add event listeners
            this.m_Sheet.Changed["Text"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
            this.m_Sheet.Changed["Bounds"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
            this.m_Sheet.Changed["Color"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
            this.SlideDisplay.Changed["Slide"].Add(new PropertyEventHandler(this.repaint_dispatcher_.Dispatcher));
        }
コード例 #24
0
        public SSSlideNetworkService(SendingQueue sender, PresentationModel presentation, DeckModel deck, SlideModel slide)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;
            this.m_Deck = deck;
            this.m_Slide = slide;

            this.m_SubmissionStyleChangeDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler( this.HandleChange ) );
            this.m_Slide.Changed["SubmissionStyle"].Add( this.m_SubmissionStyleChangeDispatcher.Dispatcher );

            this.m_AnnotationSheetsCollectionHelper = new SSSheetsCollectionHelper(this, "AnnotationSheets", SheetMessage.SheetCollection.AnnotationSheets);
        }
コード例 #25
0
        public PresentationNetworkService(SendingQueue sender, PresentationModel presentation)
        {
            this.m_Sender = sender;
            this.m_Presentation = presentation;

            this.m_DeckTraversalsCollectionHelper = new DeckTraversalsCollectionHelper(this);

            this.m_QuickPollNetworkService = new QuickPollNetworkService( this.m_Sender, this.m_Presentation );

            this.m_QuickPollChangedDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler( this.HandleQuickPollChanged ) );
            this.m_Presentation.Changed["QuickPoll"].Add( this.m_QuickPollChangedDispatcher.Dispatcher );
        }
コード例 #26
0
        public XPSPageRenderer(SlideDisplayModel display, XPSPageSheetModel sheet)
            : base(display,sheet)
        {
            this.m_Display = display;
            this.m_Sheet = sheet;

            this.repaint_dispatcher_ = new EventQueue.PropertyEventDispatcher(this.SlideDisplay.EventQueue, this.Repaint);
            if (this.m_Sheet != null) {
                this.m_Sheet.Changed["Bounds"].Add(new PropertyEventHandler(repaint_dispatcher_.Dispatcher));
                this.SlideDisplay.Changed["Slide"].Add(new PropertyEventHandler(repaint_dispatcher_.Dispatcher));
            }
        }
コード例 #27
0
        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);
        }
コード例 #28
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sender">The network queue to send messages on</param>
        /// <param name="model">The presenter model</param>
        public StudentSubmissionNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.m_Sender = sender;
            this.m_Model = model;

            // Setup the event listener for this
            this.m_SendChangeDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler(this.HandleSendSubmission) );

            //FV: Not locking here resolves a lock order warning.
            //using( Synchronizer.Lock( this.m_Model.ViewerState.SyncRoot ) ) {
                this.m_Model.ViewerState.Changed["StudentSubmissionSignal"].Add( this.m_SendChangeDispatcher.Dispatcher );
            //}
        }
コード例 #29
0
        /// <summary>
        /// Constructs this control
        /// </summary>
        public SlidePreview(PresenterModel model, Control linked)
        {
            this.m_Model = model;

            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Linked = linked;
            this.m_Linked.SizeChanged += new EventHandler(this.OnLinkedControlSizeChanged);
            this.m_Linked.LocationChanged += new EventHandler(this.OnLinkedControlSizeChanged);
            this.m_Linked.DockChanged += new EventHandler(this.OnLinkedControlSizeChanged);
            //this.OnLinkedControlSizeChanged(this, EventArgs.Empty);

            // Create the control's properties
            this.SuspendLayout();

            this.Name = "SlidePreview";
            this.Visible = false;
            this.BackColor = System.Drawing.Color.Black;
            this.DockPadding.All = 4;

            this.m_PreviewSlideViewer = new MainSlideViewer(this.m_Model, false);
            this.m_PreviewSlideViewer.Dock = DockStyle.Fill;
            //Set the disposition to always be public
            using (Synchronizer.Lock(this.m_PreviewSlideViewer.SlideDisplay.SyncRoot)) {
                this.m_PreviewSlideViewer.SlideDisplay.SheetDisposition = Model.Presentation.SheetDisposition.SecondMonitor;
            }

            //Listen to changes in the role
            this.m_Model.Participant.Changed["Role"].Add(new PropertyEventHandler(this.onRoleChange));
            //Set the initial role
            this.onRoleChange(this, null);

            this.m_SlidePreviewChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleSlidePreviewChanged));
            this.m_Model.ViewerState.Changed["SlidePreviewEnabled"].Add(this.m_SlidePreviewChangedDispatcher.Dispatcher);
            this.m_Model.ViewerState.Changed["SlidePreviewVisible"].Add(this.m_SlidePreviewChangedDispatcher.Dispatcher);
            this.m_SlidePreviewSizeChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleSlidePreviewSizeChanged));
            this.m_Model.ViewerState.Changed["SlidePreviewWidth"].Add(this.m_SlidePreviewSizeChangedDispatcher.Dispatcher);
            this.m_Model.ViewerState.Changed["SlidePreviewHeight"].Add(this.m_SlidePreviewSizeChangedDispatcher.Dispatcher);

            this.Controls.Add(this.m_PreviewSlideViewer);

            // Initialize the SlidePreview's visibility.
            this.m_SlidePreviewChangedDispatcher.Dispatcher(this, null);
            this.m_SlidePreviewSizeChangedDispatcher.Dispatcher(this, null);

            this.ResumeLayout();

            // Create the control immediately, or else event queue will never execute anything (chicken and the egg).
            this.CreateHandle();
        }
コード例 #30
0
        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");
        }
コード例 #31
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sender">The sending queue to post messages to</param>
        /// <param name="role">The InstructorModel to create this class for</param>
        public InstructorWebService(SendingQueue sender, InstructorModel role)
        {
            this.m_Sender = sender;
            this.m_Instructor = role;

            // Handle basic changes
            this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleGenericChange));
            this.m_Instructor.Changed["ForcingStudentNavigationLock"].Add(this.m_GenericChangeDispatcher.Dispatcher);
            this.m_Instructor.Changed["AcceptingStudentSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher);
            this.m_Instructor.Changed["AcceptingQuickPollSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher);

            // Handle changes to the current deck traversal
            this.m_CurrentDeckTraversalChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleCurrentDeckTraversalChanged));
            this.m_Instructor.Changed["CurrentDeckTraversal"].Add(this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher);
            this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher(this, null);
        }