Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public SaveAllDecksMenuItem(PresenterModel model, DeckMarshalService marshal)
        {
            this.m_Model = model;
            this.m_SaveDeckDialog = new SaveDeckDialog(model, marshal);

            this.Text = Strings.SaveAllDecks;
        }
Ejemplo n.º 3
0
        public OpenDeckMenuItem(PresenterModel model, DeckMarshalService marshal)
        {
            this.m_Model = model;
            this.m_OpenDeckDialog = new OpenDeckDialog(model, marshal);

            this.Text = Strings.OpenDeck;
            this.Shortcut = Shortcut.CtrlO;
            this.ShowShortcut = true;
        }
Ejemplo n.º 4
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());
 }
Ejemplo n.º 5
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;
                });
        }
Ejemplo n.º 6
0
        public SaveOnCloseDialog(PresenterModel model, DeckMarshalService marshal, EventArgs ea)
        {
            this.m_Model          = model;
            this.m_Marshal        = marshal;
            this.m_SaveDeckDialog = new SaveDeckDialog(this.m_Model, this.m_Marshal);
            this.e               = ea;
            this.Cancel          = false;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;

            this.Size     = new Size(300, 110);
            this.Text     = "Classroom Presenter 3";
            this.Location = new Point(1000, 1000);

            Label label = new Label();

            label.Text     = Strings.ToSaveDeck;
            label.Location = new Point(10, 10);
            label.Size     = new Size(250, 20);
            this.Controls.Add(label);

            Button btnYes = new Button();

            btnYes.Parent       = this;
            btnYes.Text         = Strings.Yes;
            btnYes.Location     = new Point(20, 40);
            btnYes.DialogResult = DialogResult.OK;
            btnYes.Click       += new EventHandler(btnYes_Click);

            Button btnNo = new Button();

            btnNo.Parent       = this;
            btnNo.Text         = Strings.No;
            btnNo.Location     = new Point(100, 40);
            btnNo.DialogResult = DialogResult.Cancel;//??
            btnNo.Click       += new EventHandler(btnNo_Click);

            Button btnCancel = new Button();

            btnCancel.Parent       = this;
            btnCancel.Text         = Strings.Cancel;
            btnCancel.Location     = new Point(180, 40);
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click       += new EventHandler(btnCancel_Click);
        }
Ejemplo n.º 7
0
        public SaveOnCloseDeckDialog(PresenterModel model, DeckMarshalService marshal, EventArgs ea)
        {
            this.m_Model          = model;
            this.m_Marshal        = marshal;
            this.m_SaveDeckDialog = new SaveDeckDialog(this.m_Model, this.m_Marshal);
            this.e      = ea;
            this.Cancel = false;

            this.Size     = new Size(300, 100);
            this.Text     = "Classroom Presenter";
            this.Location = new Point(1000, 1000);

            Label label = new Label();

            label.Text     = "Would you like to save your deck?";
            label.Location = new Point(10, 10);
            label.Size     = new Size(200, 20);
            this.Controls.Add(label);

            Button btnYes = new Button();

            btnYes.Parent       = this;
            btnYes.Text         = "Yes";
            btnYes.Location     = new Point(20, 40);
            btnYes.DialogResult = DialogResult.OK;
            btnYes.Click       += new EventHandler(btnYes_Click);

            Button btnNo = new Button();

            btnNo.Parent       = this;
            btnNo.Text         = "No";
            btnNo.Location     = new Point(100, 40);
            btnNo.DialogResult = DialogResult.Cancel;//??
            btnNo.Click       += new EventHandler(btnNo_Click);

            Button btnCancel = new Button();

            btnCancel.Parent       = this;
            btnCancel.Text         = "Cancel";
            btnCancel.Location     = new Point(180, 40);
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click       += new EventHandler(btnCancel_Click);
        }
Ejemplo n.º 8
0
 public SaveDeckDialog(PresenterModel model, DeckMarshalService marshal)
 {
     this.m_Model   = model;
     this.m_Marshal = marshal;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// This constructor is for the case where the app is started normally (not as a CXP capability).
        /// </summary>
        /// <param name="loader"></param>
        /// <param name="model"></param>
        public ViewerForm(DeckMarshalService loader, PresenterModel model) {
            Trace.WriteLine("Start ViewerForm Ctor");
            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model = model;
            this.m_Marshal = loader;

            UpdateTitle();

            FontSetting();

            this.Font = ViewerStateModel.FormFont;
            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            Trace.WriteLine("Get Icon");

            this.Icon = new Icon( thisExe.GetManifestResourceStream( "UW.ClassroomPresenter.Presenter.ico" ) );

            this.StartPosition = FormStartPosition.Manual;
            this.loadRegSettings();
            this.MinimumSize = new Size(440, 330);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, loader, cfd);

            Trace.WriteLine("Create tool bars");

            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            //this.m_ClassroomBrowser = new AutoDisplayClassroomsBrowser(this.m_Model);
            Trace.WriteLine("Make StartupForm");

            this.m_StartupForm = new StartupForm(this.m_Model, this.m_EventQueue);
            Trace.WriteLine("Make ViewerPresentationLayout");

            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);

            //this.m_ClassroomBrowser.Dock = DockStyle.Fill;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);

            // Hack: toggle the second monitor to make it scale correctly when using Surface Pro 3.
            // Bounds need to be set after the ViewerPresentationLayout control is added,
            // Otherwise DPI scaling appears to be done incorrectly.  This issue so far
            // appears to be unique to the Surface Pro 3.
            using (Synchronizer.Lock(model.ViewerState.SyncRoot)) {
                if (model.ViewerState.SecondMonitorEnabled) {
                    model.ViewerState.SecondMonitorEnabled = false;
                    model.ViewerState.SecondMonitorEnabled = true;
                }
            }

            //this.Controls.Add(this.m_ClassroomBrowser);
            this.m_StartupForm.Visible = false;

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            Trace.WriteLine("Make KeyEventHandler");

            this.KeyDown += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));


            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            Trace.WriteLine("Make EventDispatcher");

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            Trace.WriteLine("Make FullScreenAdapter");

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.Activated += this.ShowStartup;
            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }
            Trace.WriteLine("ViewerForm Ctor done.");

        }
Ejemplo n.º 10
0
        /// <summary>
        /// This is called from Dispose
        /// </summary>
        private void DisposeCapabilityResources() {
            if (m_DeckMatcher != null) {
                m_DeckMatcher.Dispose();
                m_DeckMatcher = null;
            }

            if (m_Association != null) {
                m_Association.Dispose();
                m_Association = null;
            }

            if (m_Undo != null) {
                m_Undo.Dispose();
                m_Undo = null;
            }

            if (m_Registry != null) {
                m_Registry.SaveAllProperties();
                m_Registry.Dispose();
                m_Registry = null;
            }

            if (m_ViewerState != null) {
                m_ViewerState.Dispose();
                m_ViewerState = null;
            }

            if (m_Loader != null) {
                m_Loader.Dispose();
                m_Loader = null;
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// This constructor is used for launching as a CXP capability.
        /// </summary>
        public ViewerForm() {

            Application.EnableVisualStyles();
            //Application.DoEvents();  //Note: this seems to cause problems in the CXP Capability context.

#if DEBUG && LOGGING
            LoggingService logger = new LoggingService();
#endif
            PresenterModel model = new PresenterModel();
            m_Loader = new DefaultDeckMarshalService();

            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model = model;
            this.m_Marshal = m_Loader;

            UpdateTitle();

            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            this.Icon = new Icon( thisExe.GetManifestResourceStream( "UW.ClassroomPresenter.Presenter.ico" ) );

            this.StartPosition = FormStartPosition.Manual;
            this.loadRegSettings();
            this.MinimumSize = new Size(440, 330);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, m_Loader, cfd);


            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);
            //this.m_MainToolBar.Dock = DockStyle.Top;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);
        
            // Hack: toggle the second monitor to make it scale correctly when using Surface Pro 3.
            // Bounds need to be set after the ViewerPresentationLayout control is added,
            // Otherwise DPI scaling appears to be done incorrectly.  This issue so far
            // appears to be unique to the Surface Pro 3.
            using (Synchronizer.Lock(model.ViewerState.SyncRoot)) {
                if (model.ViewerState.SecondMonitorEnabled) {
                    model.ViewerState.SecondMonitorEnabled = false;
                    model.ViewerState.SecondMonitorEnabled = true;
                }
            }

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            this.KeyDown += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));

            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }

            m_ViewerState = new ViewerStateService(model.ViewerState);
            m_Registry = new RegistryService(model.ViewerState); 
#if DEBUG && LOGGING
            logger.AttachToModel(model.ViewerState);
#endif
            PrintingService printing = new PrintingService(model.ViewerState);
            m_Undo = new WorkspaceUndoService(this.m_EventQueue, model);

            m_Association = new NetworkAssociationService(this.m_EventQueue, model);
            m_DeckMatcher = new DeckMatcherService(this.m_EventQueue, model);
            
        }
Ejemplo n.º 12
0
        /// <summary>
        /// This constructor is used for launching as a CXP capability.
        /// </summary>
        public ViewerForm() {

            Application.EnableVisualStyles();
            //Application.DoEvents();  //Note: this seems to cause problems in the CXP Capability context.

#if DEBUG && LOGGING
            LoggingService logger = new LoggingService();
#endif
            PresenterModel model = new PresenterModel();
            m_Loader = new DefaultDeckMarshalService();

            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model = model;
            this.m_Marshal = m_Loader;

            UpdateTitle();

            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            this.Icon = new Icon( thisExe.GetManifestResourceStream( "UW.ClassroomPresenter.Presenter.ico" ) );

            // The form should fill 5/6 of the screen by default.
            // FIXME: Load/Store previous window size from/in the registry.
            this.Size = new Size(SystemInformation.WorkingArea.Size.Width * 5 / 6,
                SystemInformation.WorkingArea.Size.Height * 5 / 6);
            // the form should be no smaller than 1/2 it's original size
            this.MinimumSize = new Size(this.Size.Width / 2, this.Size.Height / 2);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, m_Loader, cfd);


            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);
            //this.m_MainToolBar.Dock = DockStyle.Top;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            this.KeyDown += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));

            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }

            m_ViewerState = new ViewerStateService(model.ViewerState);
            m_Registry = new RegistryService(model.ViewerState); 
#if DEBUG && LOGGING
            logger.AttachToModel(model.ViewerState);
#endif
            PrintingService printing = new PrintingService(model.ViewerState);
            m_Undo = new WorkspaceUndoService(this.m_EventQueue, model);

            m_Association = new NetworkAssociationService(this.m_EventQueue, model);
            m_DeckMatcher = new DeckMatcherService(this.m_EventQueue, model);
            
        }
Ejemplo n.º 13
0
        /// <summary>
        /// This constructor is for the case where the app is started normally (not as a CXP capability).
        /// </summary>
        /// <param name="loader"></param>
        /// <param name="model"></param>
        public ViewerForm(DeckMarshalService loader, PresenterModel model) {

            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model = model;
            this.m_Marshal = loader;

            UpdateTitle();

            FontSetting();

            this.Font = ViewerStateModel.FormFont;
            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            this.Icon = new Icon( thisExe.GetManifestResourceStream( "UW.ClassroomPresenter.Presenter.ico" ) );

            // The form should fill 5/6 of the screen by default.
            // FIXME: Load/Store previous window size from/in the registry.
            this.Size = new Size(SystemInformation.WorkingArea.Size.Width * 5 / 6,
                SystemInformation.WorkingArea.Size.Height * 5 / 6);
            // the form should be no smaller than 1/2 it's original size
            this.MinimumSize = new Size(this.Size.Width / 2, this.Size.Height / 2);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, loader, cfd);

            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            //this.m_ClassroomBrowser = new AutoDisplayClassroomsBrowser(this.m_Model);
            this.m_StartupForm = new StartupForm(this.m_Model, this.m_EventQueue);
            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);

            //this.m_ClassroomBrowser.Dock = DockStyle.Fill;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);
            //this.Controls.Add(this.m_ClassroomBrowser);
            this.m_StartupForm.Visible = false;

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            this.KeyDown += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));


            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.Activated += this.ShowStartup;
            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }

        }
Ejemplo n.º 14
0
        public SaveOnCloseDeckDialog(PresenterModel model, DeckMarshalService marshal, EventArgs ea)
        {
            this.m_Model = model;
            this.m_Marshal = marshal;
            this.m_SaveDeckDialog = new SaveDeckDialog(this.m_Model, this.m_Marshal);
            this.e = ea;
            this.Cancel = false;

            this.Size = new Size(300, 100);
            this.Text = "Classroom Presenter";
            this.Location = new Point(1000, 1000);

            Label label = new Label();
            label.Text = "Would you like to save your deck?";
            label.Location = new Point(10, 10);
            label.Size = new Size(200, 20);
            this.Controls.Add(label);

            Button btnYes = new Button();
            btnYes.Parent = this;
            btnYes.Text = "Yes";
            btnYes.Location = new Point(20, 40);
            btnYes.DialogResult = DialogResult.OK;
            btnYes.Click += new EventHandler(btnYes_Click);

            Button btnNo = new Button();
            btnNo.Parent = this;
            btnNo.Text = "No";
            btnNo.Location = new Point(100, 40);
            btnNo.DialogResult = DialogResult.Cancel;//??
            btnNo.Click += new EventHandler(btnNo_Click);

            Button btnCancel = new Button();
            btnCancel.Parent = this;
            btnCancel.Text = "Cancel";
            btnCancel.Location = new Point(180, 40);
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click += new EventHandler(btnCancel_Click);
        }
Ejemplo n.º 15
0
        public SaveOnCloseDialog(PresenterModel model, DeckMarshalService marshal, EventArgs ea)
        {
            this.m_Model = model;
            this.m_Marshal = marshal;
            this.m_SaveDeckDialog = new SaveDeckDialog(this.m_Model, this.m_Marshal);
            this.e = ea;
            this.Cancel = false;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;

            this.Size = new Size(300, 110);
            this.Text = "Classroom Presenter 3";
            this.Location = new Point(1000, 1000);

            Label label = new Label();
            label.Text = Strings.ToSaveDeck;
            label.Location = new Point(10, 10);
            label.Size = new Size(250, 20);
            this.Controls.Add(label);

            Button btnYes = new Button();
            btnYes.Parent = this;
            btnYes.Text = Strings.Yes;
            btnYes.Location = new Point(20, 40);
            btnYes.DialogResult = DialogResult.OK;
            btnYes.Click += new EventHandler(btnYes_Click);

            Button btnNo = new Button();
            btnNo.Parent = this;
            btnNo.Text = Strings.No;
            btnNo.Location = new Point(100, 40);
            btnNo.DialogResult = DialogResult.Cancel;//??
            btnNo.Click += new EventHandler(btnNo_Click);

            Button btnCancel = new Button();
            btnCancel.Parent = this;
            btnCancel.Text = Strings.Cancel;
            btnCancel.Location = new Point(180, 40);
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click += new EventHandler(btnCancel_Click);
        }
Ejemplo n.º 16
0
 public OpenDeckDialog(PresenterModel model, DeckMarshalService marshal)
 {
     this.m_Model = model;
     this.m_Marshal = marshal;
 }
Ejemplo n.º 17
0
        public SaveDeckAsMenuItem(PresenterModel model, DeckMarshalService marshal)
        {
            this.m_Model = model;
            this.m_SaveDeckDialog = new SaveDeckDialog(model, marshal);

            this.Text = Strings.SaveDeckAs;
            this.Shortcut = Shortcut.F12;
            this.ShowShortcut = true;
        }