コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
0
 public RedoMenuItem(ControlEventQueue dispatcher, PresenterModel model)
     : base(dispatcher, model)
 {
     this.Text = Strings.Redo;
     this.Shortcut = Shortcut.CtrlY;
     this.ShowShortcut = true;
 }
コード例 #4
0
        public EditMenu(ControlEventQueue dispatcher, PresenterModel model)
        {
            this.Text = Strings.Edit;

            this.MenuItems.Add(new UndoMenuItem(dispatcher, model));
            this.MenuItems.Add(new RedoMenuItem(dispatcher, model));
        }
コード例 #5
0
ファイル: MainToolBar.cs プロジェクト: ClassroomPresenter/CP3
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">The model that this component modifies</param>
        public MainToolBar(PresenterModel model, ControlEventQueue dispatcher)
        {
            // Initialize private variables
            this.m_EventQueue = dispatcher;
            this.m_Model = model;

            // Setup the object UI description
            this.SuspendLayout();

            this.Name = "MainToolBar";
            this.GripStyle = ToolStripGripStyle.Hidden;

            // Create the primary image list for this object
            this.ImageList = new ImageList();
            this.ImageList.ImageSize = new Size(40, 40);
            this.ImageList.ColorDepth = ColorDepth.Depth32Bit;

            // Set the default button size
            this.ImageScalingSize = new Size( 40, 40 );
            this.AutoSize = true;

            // Assign a custom renderer to this object so that rendering appears
            // in the old style
            this.Renderer = new CustomRenderer();

            this.ResumeLayout();
        }
コード例 #6
0
ファイル: FileMenu.cs プロジェクト: ClassroomPresenter/CP3
        public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd) {
            this.Text = Strings.File;

            open_deck_ = new OpenDeckMenuItem(model, marshal);
            this.MenuItems.Add(open_deck_);
            this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal));
            this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar.
            this.MenuItems.Add(new SaveDeckMenuItem(model, marshal));
            this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal));
            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.
            this.MenuItems.Add(new ExportDeckAsImageItem(model));
            this.MenuItems.Add(new ExportDeckAsHTMLItem(model));
            this.MenuItems.Add(new ExportInkMenuItem(model));
            this.MenuItems.Add(new MenuItem("-"));
            this.MenuItems.Add(new PageSetupMenuItem(this, model));
            this.MenuItems.Add(new PrintPreviewMenuItem(this, model));
            this.MenuItems.Add(new PrintMenuItem(this, model));
            this.MenuItems.Add(new MenuItem( "-" ));
            this.MenuItems.Add(new ExitMenuItem(cfd));

            presenter_model_ = model;
            presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property<PresentationModel>.EventHandler(this.HandlePresentationChanged));
            presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property<DeckTraversalModel>.EventHandler(this.HandleDeckChanged));
        }
コード例 #7
0
 public FilmStripAlignmentMenu(ControlEventQueue dispatcher, PresenterModel model)
     : base(Strings.FilmStripAlignment)
 {
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Left, Strings.Left));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Right, Strings.Right));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Top, Strings.Top));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Bottom, Strings.Bottom));
 }
コード例 #8
0
 public ViewerMainMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, FileMenu.CloseFormDelegate cfd)
 {
     this.MenuItems.Add(new FileMenu(dispatcher, model, marshal, cfd));
     this.MenuItems.Add(new EditMenu(dispatcher, model));
     this.MenuItems.Add(new ViewMenu(dispatcher, model));
     //this.MenuItems.Add(new ConnectMenu(dispatcher, model));
     this.MenuItems.Add(new ToolsMenu(model));
     this.MenuItems.Add(new DecksMenu(dispatcher, model));
     this.MenuItems.Add(new StudentMenu(dispatcher, model));
     this.MenuItems.Add(new HelpMenu());
 }
コード例 #9
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);
            }
コード例 #10
0
        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;
                });
        }
コード例 #11
0
            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);
            }
コード例 #12
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);
        }
コード例 #13
0
        public CloseDeckMenuItem(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.Text = Strings.CloseDeck;
            this.m_Marshal = marshal;

            this.m_CurrentDeckTraversalChangedDispatcher =
                this.m_Model.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher,
                delegate(Property<DeckTraversalModel>.EventArgs args) {
                    this.CurrentDeckTraversal = args.New;
                });
        }
コード例 #14
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();
        }
コード例 #15
0
        public MainToolBars(PresenterModel model, ControlEventQueue dispatcher)
        {
            this.m_Model = model;
            this.m_EventQueue = dispatcher;

            this.m_StylusToolBarButton = new StylusToolBarButtons(this.m_Model);
            this.m_SlideToolBarButton = new SlideToolBarButtons(this.m_Model);
            this.m_StudentToolBarButton = new StudentToolBarButtons(this.m_Model);
            this.m_UndoToolBarButton = new UndoToolBarButtons(this.m_Model);
            this.m_InstructorToolBarButton = new InstructorToolBarButtons(this.m_Model);
            this.m_DeckNavigationToolBarButton = new DeckNavigationToolBarButtons(this.m_Model);

            this.m_MainToolBar = new MainToolBar(this.m_Model, this.m_EventQueue);
            this.m_StylusToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_SlideToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_StudentToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_UndoToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_InstructorToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);
            this.m_MainToolBar.Items.Add(new ToolStripSeparator());
            this.m_DeckNavigationToolBarButton.MakeButtons(this.m_MainToolBar, this.m_EventQueue);

            this.m_MainClassmateToolBar = new MainToolBar(this.m_Model, this.m_EventQueue);
            this.m_ExtraClassmateToolBar = new MainToolBar(this.m_Model, this.m_EventQueue);
            this.m_StylusToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);
            this.m_MainClassmateToolBar.Items.Add(new ToolStripSeparator());
            this.m_ExtraClassmateToolBar.Items.Add(new ToolStripSeparator());
            this.m_SlideToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);
            this.m_StudentToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);
            this.m_UndoToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);
            this.m_InstructorToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);
            this.m_DeckNavigationToolBarButton.MakeButtons(this.m_MainClassmateToolBar, this.m_ExtraClassmateToolBar, this.m_EventQueue);

            this.m_MainToolBar.Dock = DockStyle.Top;
            this.m_MainClassmateToolBar.Dock = DockStyle.Right;
            this.m_ExtraClassmateToolBar.Dock = DockStyle.Right;

            this.m_Disposed = false;

            this.m_ToolBarModeListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ToolBarModeChanged));
            this.m_Model.ViewerState.Changed["ClassmateMode"].Add(this.m_ToolBarModeListener.Dispatcher);
            this.m_ToolBarModeListener.Dispatcher(this, null);
        }
コード例 #16
0
        /// <summary>
        /// Makes all the button associated with changing slide properties
        /// </summary>
        /// <param name="parent">The parent ToolStrip</param>
        /// <param name="dispatcher">The event queue</param>
        public void MakeButtons(ToolStrip parent, ControlEventQueue dispatcher)
        {
            SlideToolBarButton clear, zoom;

            // Add the clear button
            clear = new ClearInkSheetToolBarButton( dispatcher, this.m_Model );
            clear.Image = UW.ClassroomPresenter.Properties.Resources.slideerase;

            // Add the zoom button
            zoom = new ZoomToolBarButton( dispatcher, this.m_Model );
            zoom.Image = UW.ClassroomPresenter.Properties.Resources.minimize;

            // Add the buttons to the parent ToolStrip
            parent.Items.Add(clear);
            parent.Items.Add(new ToolStripSeparator());
            parent.Items.Add(zoom);
        }
コード例 #17
0
        public FullScreenAdapter(PresenterModel model, ContainerControl control)
        {
            this.m_Model = model;
            this.m_Control = control;

            this.m_EventQueue = new ControlEventQueue(this.m_Control);
            this.m_FullScreenChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleFullScreenChanged));
            this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleRoleChanged));

            this.m_Model.ViewerState.Changed["PrimaryMonitorFullScreen"].Add(this.m_FullScreenChangedDispatcher.Dispatcher);
            this.m_FullScreenChangedDispatcher.Dispatcher(this, null);

            this.m_Model.Participant.Changed["Role"].Add(this.m_RoleChangedDispatcher.Dispatcher);
            this.m_RoleChangedDispatcher.Dispatcher(this, null);
            this.m_FullScreenButtons = new FullScreenButtons(this.m_Model, this.m_EventQueue);
            //this.m_FullScreenToolBar.Dock = DockStyle.Top;
        }
コード例 #18
0
        /// <summary>
        /// Make the correct buttons and add them to the given ToolStrip
        /// </summary>
        /// <param name="parent">The parent ToolStrip</param>
        /// <param name="dispatcher">The event queue</param>
        public void MakeButtons(ToolStrip parent, ControlEventQueue dispatcher)
        {
            UndoToolBarButton undo = new UndoToolBarButton(dispatcher, this.m_Model);
            RedoToolBarButton redo = new RedoToolBarButton(dispatcher, this.m_Model);
            Bitmap img;

            img = new Bitmap( Image.FromStream( this.GetType().Assembly.GetManifestResourceStream( "UW.ClassroomPresenter.Viewer.ToolBars.Icons.undo.png" ) ) );
            Misc.ImageListHelper.Add( img, parent.ImageList );
            undo.ImageIndex = parent.ImageList.Images.Count - 1;

            img = new Bitmap( Image.FromStream( this.GetType().Assembly.GetManifestResourceStream( "UW.ClassroomPresenter.Viewer.ToolBars.Icons.redo.png" ) ) );
            Misc.ImageListHelper.Add( img, parent.ImageList );
            redo.ImageIndex = parent.ImageList.Images.Count - 1;

            parent.Items.Add(undo);
            parent.Items.Add(redo);
        }
コード例 #19
0
        /// <summary>
        /// Makes all the button associated with changing slide properties
        /// </summary>
        /// <param name="main">The main ToolStrip</param>
        /// <param name="extra">The extra ToolStrip</param>
        /// <param name="dispatcher">The event queue</param>
        public void MakeButtons(ToolStrip main, ToolStrip extra, ControlEventQueue dispatcher)
        {
            SlideToolBarButton clear, zoom;

            // Add the clear button
            clear = new ClearInkSheetToolBarButton( dispatcher, this.m_Model );
            clear.Image = UW.ClassroomPresenter.Properties.Resources.slideerase;

            // Add the zoom button
            zoom = new ZoomToolBarButton( dispatcher, this.m_Model );
            zoom.Image = UW.ClassroomPresenter.Properties.Resources.minimize;
            zoom.AutoSize = false;
            zoom.Width = 54;
            zoom.Height = 44;

            // Add the buttons to the parent ToolStrip
            main.Items.Add(clear);
            extra.Items.Add(zoom);
        }
コード例 #20
0
        /// <summary>
        /// Constructor for this menu item
        /// </summary>
        /// <param name="dispatcher">The event dispatcher</param>
        /// <param name="model">The model to work with</param>
        public AcceptingQuickPollSubmissionsMenuItem( ControlEventQueue dispatcher, PresenterModel model )
            : base(dispatcher, model)
        {
            this.Text = Strings.EnableQuickPolling;
            this.m_HandleAcceptingQPChangedDispatcher = new EventQueue.PropertyEventDispatcher( this.m_EventQueue, new PropertyEventHandler( this.HandleAcceptingQPChanged ) );
            using( Synchronizer.Lock( this.m_Model.Participant.SyncRoot ) ) {
                //Listen to to changes in Accepting QP for the current role, if it is an InstructorModel
                if( this.m_Role is InstructorModel ) {
                    using( Synchronizer.Lock( this.m_Model.Participant.Role.SyncRoot ) ) {
                        ((InstructorModel)this.m_Role).Changed["AcceptingQuickPollSubmissions"].Add( this.m_HandleAcceptingQPChangedDispatcher.Dispatcher );
                    }
                }
            }
            this.HandleAcceptingQPChanged( this, null );

            // Enable or disable based on there being a valid slide
            this.Enabled = false;
            this.m_Adapter = new WorkspaceModelAdapter( this.m_EventQueue, this, this.m_Model );
        }
コード例 #21
0
        public ClassroomsListView(PresenterModel model)
        {
            if (model == null)
                throw new ArgumentNullException("model");

            this.m_EventQueue = new ControlEventQueue(this);
            this.m_Model = model;

            this.View = View.Details;
            this.FullRowSelect = true;
            this.GridLines = true;
            this.Sorting = SortOrder.None;
            this.CheckBoxes = false;
            this.MultiSelect = false;
            this.HideSelection = false;

            // TODO: Add icons for classrooms.
            // In the mean time, this serves to make the rows big enough to
            // be an easy target for a stylus.
            this.SmallImageList = new ImageList();
            this.SmallImageList.ImageSize = new Size(1, 40);

            // Set the font for list view items
            this.Font = new Font(this.Font.FontFamily, this.Font.Size * 4 / 3 );

            this.Columns.AddRange(new ColumnHeader[] { new ColumnHeader(), new ColumnHeader(), new ColumnHeader()});
            foreach(ColumnHeader column in this.Columns) column.Width = -1;
            this.Columns[0].Text = "Classrooms";
            this.Columns[1].Text = "Participants";
            this.Columns[2].Text = "Protocol";

            // Create a handle immediately so the ListViewItems can marshal event handlers to the creator thread.
            this.CreateHandle();

            // Add a default local classroom to the list
            defaultClassroomModel = new ClassroomModel( null, "Disconnected", ClassroomModelType.None );
            defaultClassroom = new ClassroomListViewItem( this.m_EventQueue, defaultClassroomModel );
            this.Items.Add( defaultClassroom );
            defaultClassroom.Selected = true;

            // Set up a helper to add other classrooms
            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
コード例 #22
0
        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.
        }
コード例 #23
0
        /// <summary>
        /// Instantiates a new <see cref="SlideDisplayModel"/>.
        /// </summary>
        /// <param name="control">
        /// The control that will be used for <see cref="CreateGraphics"/>; presumably, the <see cref="SlideViewer"/>
        /// on which the slide will be rendered.
        /// </param>
        public SlideDisplayModel(Control control, ControlEventQueue dispatcher)
        {
            this.m_Control = control;
            this.m_Graphics = null;
            this.m_EventQueue = dispatcher;
            this.m_Renderer = new Renderer();

            // Initialize transform matrices to the identity matrix.
            this.m_PixelTransform = new Matrix();
            this.m_InkTransform = new Matrix();

            // Initialize the bounds to an empty rectangle to avoid NullReferenceExceptions.
            this.m_Bounds = Rectangle.Empty;

            // Default is to render real time ink.
            this.m_RenderLocalRealTimeInk = true;

            //Initialize Disposition to Instructor and display BG as default
            this.m_SheetDisposition = SheetDisposition.All | SheetDisposition.Background;
        }
コード例 #24
0
        public SlideViewer()
        {
            if (this.m_EventQueue == null) {
                this.m_EventQueue = new ControlEventQueue(this);
            }
            if (this.m_SlideDisplay == null) {
                this.m_SlideDisplay = new SlideDisplayModel(this, this.m_EventQueue);
            }
            this.m_DefaultDeckBGColor = Color.White;

            // Enable double-buffering of the SlideView.
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);

            this.m_ContentSlideRenderer = new SlideRenderer(this.m_SlideDisplay, "ContentSheets");
            this.m_AnnotationsSlideRenderer = new SlideRenderer(this.m_SlideDisplay, "AnnotationSheets");

            this.m_SlideDisplay.Invalidated += new InvalidateEventHandler(this.HandleDisplayInvalidated);

            this.Name = "SlideViewer";
        }
コード例 #25
0
        public LassoPlugin(Control control, SlideDisplayModel display)
        {
            this.m_EventQueue = display.EventQueue;
            this.m_Control = control;
            this.m_Display = display;
            this.m_SelectionPointsTable = new Hashtable();
            this.m_SelectionBoundaryTable = new Hashtable();
            this.m_SelectionPreviousPointTable = new Hashtable();
            this.m_Renderer = new Renderer();

            this.m_Control.Paint += new PaintEventHandler(this.HandleControlPaint);

            this.m_DisplayBoundsChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleDisplayBoundsChanged));
            this.m_DisplayInkTransformChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleDisplayInkTransformChanged));
            this.m_Display.Changed["Bounds"].Add(this.m_DisplayBoundsChangedDispatcher.Dispatcher);
            this.m_Display.Changed["InkTransform"].Add(this.m_DisplayInkTransformChangedDispatcher.Dispatcher);

            this.m_DisplayBoundsChangedDispatcher.Dispatcher(this.m_Display, null);
            this.m_DisplayInkTransformChangedDispatcher.Dispatcher(this.m_Display, null);
        }
コード例 #26
0
        /// <summary>
        /// Creates a new <see cref="ClassroomMenu"/>.
        /// </summary>
        /// <param name="model">
        /// The lists of classrooms and presentations are gathered from the
        /// protocols in the <see cref="PresenterModel.Network"/>.
        /// </param>
        public ConnectTCPMenuItem(ControlEventQueue dispatcher, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Connected = false;
            this.Text = "Connect to &TCP Server...";
            this.m_Classrooms = new List<TCPClassroomManager>();

            //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;
            }

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
コード例 #27
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">The model that this class modifies</param>
        public FullScreenButtons(PresenterModel model, ControlEventQueue dispatcher)
        {
            this.m_Model = model;

            /// <summary>
            /// Constructs all of the child buttons belonging to this class
            /// </summary>
            /// <param name="parent">The parent ToolStrip to place the buttons in</param>
            /// <param name="dispatcher">The event queue to use for events</param>

            this.ret = new ReturnButton(this.m_Model);

            // Create the back button
            this.back = new BackwardNavigationToolBarButton(dispatcher, this.m_Model);
            this.back.Image = UW.ClassroomPresenter.Properties.Resources.left;
            //this.back.AutoSize = true;

            // Create the forward button
            this.forward = new ForwardNavigationToolBarButton(dispatcher, this.m_Model);
            this.forward.Image = UW.ClassroomPresenter.Properties.Resources.right;
        }
コード例 #28
0
        /// <summary>
        /// Make the student submission button and linked nav button
        /// </summary>
        /// <param name="parent">The parent ToolStrip</param>
        /// <param name="dispatcher">The event queue</param>
        public void MakeButtons(ToolStrip parent, ControlEventQueue dispatcher)
        {
            ParticipantToolBarButton ss, qp, nav;

            ss = new AcceptingStudentSubmissionsToolBarButton( dispatcher, this.m_Model );
            ss.AutoSize = false;
            ss.Width = 68;
            ss.Height = 44;

            nav = new ForcingStudentNavigationLockToolBarButton(dispatcher, this.m_Model);
            nav.Image = UW.ClassroomPresenter.Properties.Resources.linked;
            nav.AutoSize = true;

            qp = new QuickPollToolBarButton( dispatcher, this.m_Model );
            nav.AutoSize = true;

            parent.Items.Add(ss);
            parent.Items.Add(qp);
            parent.Items.Add(new ToolStripSeparator());
            parent.Items.Add(nav);
        }
コード例 #29
0
ファイル: UDPPanel.cs プロジェクト: ClassroomPresenter/CP3
        public UDPPresentationRadioButton(ClassroomModel classroom, StartupForm stup, int i, ControlEventQueue eventqueue)
        {
            this.m_Classroom = classroom;
            this.m_EventQueue = eventqueue;
            this.m_Startup = stup;
            this.index = i;

            this.FlatStyle = FlatStyle.System;
            this.Font = Model.Viewer.ViewerStateModel.StringFont1;
            this.Location = new Point(10,
                this.m_Startup.m_UDPPanel.nameLabel.Bottom + this.index*this.Font.Height*3 - (2*this.Font.Height));
            this.Size = new Size(this.m_Startup.m_UDPPanel.Width -20, 3*this.Font.Height);
            using(Synchronizer.Lock(m_Classroom.SyncRoot))
                this.Text = this.m_Classroom.HumanName;
            this.CheckedChanged += this.HandleClick;

            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);
        }
コード例 #30
0
        /// <summary>
        /// Make all the buttons for this tool bar and add them to the bar
        /// </summary>
        /// <param name="parent">The toolbar to add the button to</param>
        /// <param name="dispatcher">The event queue to dispatch message onto</param>
        public void MakeButtons(ToolStrip parent, ControlEventQueue dispatcher)
        {
            ParticipantToolBarButton submit;

            submit = new SubmitStudentSubmissionToolBarButton( dispatcher, this.m_Model );
            submit.AutoSize = false;
            submit.Width = 68;
            submit.Height = 44;
            submit.Image = UW.ClassroomPresenter.Properties.Resources.submission;

            parent.Items.Add( submit );

            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, Strings.QuickPollYes, "Yes" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, Strings.QuickPollNo, "No" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, Strings.QuickPollBoth, "Both" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, Strings.QuickPollNeither, "Neither" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, "A", "A" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, "B", "B" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, "C", "C" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, "D", "D" ) );
            parent.Items.Add( new StudentQuickPollToolBarButton( dispatcher, this.m_Model, "E", "E" ) );
        }