Esempio n. 1
0
            public StartupTabControl(Size size, Point location, int tabIndex, StartupForm stup, PresenterModel model, ControlEventQueue eventqueue)
            {
                this.SuspendLayout();
                this.m_Startup     = stup;
                this.m_Model       = model;
                this.ItemSize      = new System.Drawing.Size(52, 18);
                this.Location      = location;
                this.Name          = "tabControl";
                this.SelectedIndex = 0;
                this.Font          = Model.Viewer.ViewerStateModel.StringFont;
                this.Size          = size;
                this.TabIndex      = tabIndex;
                this.m_AdvancedTab = new AdvancedTab(this.m_Model);
                this.m_UDPTab      = new UDPTab(this.m_Model);
                this.m_UDPTab.Controls.Add(this.m_Startup.m_UDPPanel);
                this.Controls.Add(this.m_UDPTab);
                this.Controls.Add(this.m_AdvancedTab);

                this.m_AdvancedListener = new EventQueue.PropertyEventDispatcher(
                    this.m_Startup.m_EventQueue,
                    new PropertyEventHandler(this.HandleAdvancedChanged));
                this.m_Model.ViewerState.Changed["Advanced"].Add(this.m_AdvancedListener.Dispatcher);
                this.m_AdvancedListener.Dispatcher(this, null);

                this.ControlAdded += new ControlEventHandler(UDPTabAdded);

                this.ResumeLayout();
            }
        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);
        }
Esempio n. 3
0
 public ConnectionHelper(StartupForm stup, PresenterModel model, ControlEventQueue dispatcher)
 {
     this.m_StartupForm = stup;
     this.m_TabControl  = this.m_StartupForm.m_TabControl;
     this.m_Model       = model;
     this.m_EventQueue  = dispatcher;
 }
Esempio n. 4
0
        public PresentationsPanel(PresenterModel model, StartupForm stup)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

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

            this.Font        = Model.Viewer.ViewerStateModel.StringFont;
            this.Location    = new Point(276, 10);
            this.Size        = new Size(250, 250);
            this.BorderStyle = BorderStyle.Fixed3D;
            this.AutoScroll  = true;

            Label label = new Label();

            label.FlatStyle = FlatStyle.System;
            label.Font      = Model.Viewer.ViewerStateModel.StringFont2;
            label.Size      = new Size(this.Width + 30, label.Font.Height);
            label.Location  = new Point(10, 5);
            label.Text      = Strings.PresentationsInChosenVenue;
            this.Controls.Add(label);



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

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
            public InstructorConnection(StartupForm parent, PresenterModel model, ControlEventQueue dispatcher)
                : base(parent, model, dispatcher)
            {
                this.m_PresentationsPanel             = null;
                this.m_ManualConnectionPanel          = new ManualConnectionPanel(this.m_Model, this.m_StartupForm);
                this.m_ManualConnectionPanel.Location = parent.m_UDPPanel.Location;
                this.m_ManualConnectionPanel.Size     = parent.m_UDPPanel.Size;

                /*if (!(this.m_StartupForm.Controls.Contains(this.m_TabControl))) {
                 *  this.m_StartupForm.Controls.Add(this.m_TabControl);
                 *
                 *  }*/
                if (!(this.m_StartupForm.Controls.Contains(this.m_StartupForm.m_TabGroupBox)))
                {
                    this.m_StartupForm.Controls.Add(this.m_StartupForm.m_TabGroupBox);
                    if (!(this.m_StartupForm.m_TabGroupBox.Controls.Contains(this.m_TabControl)))
                    {
                        this.m_StartupForm.m_TabGroupBox.Controls.Add(this.m_TabControl);
                    }
                }
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_ManualConnectionPanel);
                if (this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab))
                {
                    this.m_TabControl.Controls.Remove(this.m_TabControl.m_UDPTab);
                }
            }
Esempio n. 7
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);
        }
Esempio n. 8
0
            public EnableExternalMonitorCheckbox(Point location, Size size, PresenterModel model, ControlEventQueue dispatcher, StartupForm parent)
            {
                this.SuspendLayout();

                this.m_Model   = model;
                this.m_Parent  = parent;
                this.FlatStyle = FlatStyle.System;
                this.Location  = location;
                this.Font      = Model.Viewer.ViewerStateModel.StringFont2;
                this.Size      = size;
                this.Name      = "enableSecondMonitorCheckBox";
                this.Text      = Strings.EnableSecondMonitor;
                this.Enabled   = false;
                // Set the default value according to the model's current setting
                // NOTE: Split into two steps to avoid deadlock with updating the check state
                bool bShouldBeChecked = true;

                if (this.m_Model != null)
                {
                    using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
                        bShouldBeChecked = this.m_Model.ViewerState.SecondMonitorEnabled;
                    }
                }

                if (bShouldBeChecked)
                {
                    this.Checked    = true;
                    this.CheckState = CheckState.Checked;
                }
                else
                {
                    this.Checked    = false;
                    this.CheckState = CheckState.Unchecked;
                }

                this.ResumeLayout();

                // Listen for changes to the Role property
                this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(dispatcher, new PropertyEventHandler(this.HandleRoleChanged));
                this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
                this.m_RoleChangedDispatcher.Dispatcher(this, null);

                this.m_SecondMonitorChangedDispatcher = new EventQueue.PropertyEventDispatcher(dispatcher, new PropertyEventHandler(this.HandleSecondMonitorChanged));
                this.m_Model.ViewerState.Changed["SecondMonitorEnabled"].Add(this.m_SecondMonitorChangedDispatcher.Dispatcher);
                this.m_SecondMonitorChangedDispatcher.Dispatcher(this, null);
            }
Esempio n. 9
0
            public ViewerConnection(StartupForm parent, PresenterModel model, ControlEventQueue dispatcher)
                : base(parent, model, dispatcher)
            {
                if (!(this.m_StartupForm.Controls.Contains(this.m_StartupForm.m_TabGroupBox)))
                {
                    this.m_StartupForm.Controls.Add(this.m_StartupForm.m_TabGroupBox);
                    if (!(this.m_StartupForm.m_TabGroupBox.Controls.Contains(this.m_TabControl)))
                    {
                        this.m_StartupForm.m_TabGroupBox.Controls.Add(this.m_TabControl);
                    }
                }
                this.m_ManualConnectionPanel          = new ManualConnectionPanel(this.m_Model, this.m_StartupForm);
                this.m_ManualConnectionPanel.Location = parent.m_UDPPanel.Location;
                this.m_ManualConnectionPanel.Size     = new Size((parent.m_UDPPanel.Width - 10) / 2, parent.m_UDPPanel.Height);
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_ManualConnectionPanel);

                this.m_PresentationsPanel          = new PresentationsPanel(this.m_Model, this.m_StartupForm);
                this.m_PresentationsPanel.Location = new Point(parent.m_UDPPanel.Location.X + (parent.m_UDPPanel.Width + 10) / 2, parent.m_UDPPanel.Location.Y);
                this.m_PresentationsPanel.Size     = new Size((parent.m_UDPPanel.Width - 10) / 2, parent.m_UDPPanel.Height);
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_PresentationsPanel);


                using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
                    if (this.m_Model.ViewerState.Advanced)
                    {
                        if (this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab))
                        {
                            this.m_TabControl.Controls.Remove(this.m_TabControl.m_UDPTab);
                        }
                        this.m_TabControl.Controls.Add(this.m_TabControl.m_UDPTab);
                    }
                    else
                    {
                        this.m_TabControl.Controls.Remove(this.m_TabControl.m_AdvancedTab);
                        if (!(this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab)))
                        {
                            this.m_TabControl.Controls.Add(this.m_TabControl.m_UDPTab);
                        }
                        this.m_TabControl.Controls.Add(this.m_TabControl.m_AdvancedTab);
                    }
                }//This is a bit of a hack because the stuff in the tabcontrol doesn't work.  This puts the udptab in front and selected if not in advanced mode and the advanced tab in front and selected otherwise.  THis does change the order of the tabs...  not sure if that's good or bad.
            }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        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);
        }
Esempio n. 12
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);
        }
Esempio n. 13
0
 public ConnectDialogMenuItem(ControlEventQueue dispatcher, PresenterModel model)
 {
     this.Text = "Launch Connection Dialog...";
     this.m_Startup = new StartupForm(model, dispatcher);
     this.m_Model = model;
 }
Esempio n. 14
0
            public ViewerConnection(StartupForm parent, PresenterModel model, ControlEventQueue dispatcher)
                : base(parent, model, dispatcher)
            {
                if (!(this.m_StartupForm.Controls.Contains(this.m_StartupForm.m_TabGroupBox))) {
                    this.m_StartupForm.Controls.Add(this.m_StartupForm.m_TabGroupBox);
                    if (!(this.m_StartupForm.m_TabGroupBox.Controls.Contains(this.m_TabControl))) {
                        this.m_StartupForm.m_TabGroupBox.Controls.Add(this.m_TabControl);
                    }
                }
                this.m_ManualConnectionPanel = new ManualConnectionPanel(this.m_Model, this.m_StartupForm);
                this.m_ManualConnectionPanel.Location = parent.m_UDPPanel.Location;
                this.m_ManualConnectionPanel.Size = new Size((parent.m_UDPPanel.Width - 10) / 2, parent.m_UDPPanel.Height);
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_ManualConnectionPanel);

                this.m_PresentationsPanel = new PresentationsPanel(this.m_Model, this.m_StartupForm);
                this.m_PresentationsPanel.Location = new Point(parent.m_UDPPanel.Location.X + (parent.m_UDPPanel.Width + 10) / 2, parent.m_UDPPanel.Location.Y);
                this.m_PresentationsPanel.Size = new Size((parent.m_UDPPanel.Width - 10) / 2, parent.m_UDPPanel.Height);
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_PresentationsPanel);

                using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
                    if (this.m_Model.ViewerState.Advanced) {
                        if (this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab)) {
                            this.m_TabControl.Controls.Remove(this.m_TabControl.m_UDPTab);
                        }
                        this.m_TabControl.Controls.Add(this.m_TabControl.m_UDPTab);
                    }
                    else {
                        this.m_TabControl.Controls.Remove(this.m_TabControl.m_AdvancedTab);
                        if (!(this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab))) {
                            this.m_TabControl.Controls.Add(this.m_TabControl.m_UDPTab);
                        }
                        this.m_TabControl.Controls.Add(this.m_TabControl.m_AdvancedTab);
                    }
                }//This is a bit of a hack because the stuff in the tabcontrol doesn't work.  This puts the udptab in front and selected if not in advanced mode and the advanced tab in front and selected otherwise.  THis does change the order of the tabs...  not sure if that's good or bad.
            }
Esempio n. 15
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);
            }

        }
Esempio n. 16
0
        public ManualConnectionPanel(PresenterModel model, StartupForm stup)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

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

            //this.Text = "Manual Connections";
            this.Font     = Model.Viewer.ViewerStateModel.StringFont;
            this.Location = new Point(10, 10);
            this.Size     = new Size(250, 250);

            this.CreateHandle();

            this.BorderStyle = BorderStyle.Fixed3D;
            this.AutoScroll  = true;

            Label label1 = new Label();

            label1.FlatStyle = FlatStyle.System;
            label1.Font      = Model.Viewer.ViewerStateModel.StringFont2;
            label1.Text      = Strings.ManualConnectionVenues;
            label1.Location  = new Point(10, 5);
            label1.Size      = new Size(this.Width - 20, label1.Font.Height);
            this.Controls.Add(label1);

            this.UnicastLabel           = new Label();
            this.UnicastLabel.FlatStyle = FlatStyle.System;
            this.UnicastLabel.Font      = Model.Viewer.ViewerStateModel.StringFont2;
            this.UnicastLabel.Text      = Strings.Unicast;
            this.UnicastLabel.Location  = new Point(10, (int)(6 * this.UnicastLabel.Font.Height) + 5);
            this.UnicastLabel.Size      = new Size(this.Width - 20, this.UnicastLabel.Font.Height);
            this.Controls.Add(this.UnicastLabel);

#if RTP_BUILD
            this.MulticastLabel           = new Label();
            this.MulticastLabel.Text      = Strings.MultiCast;
            this.MulticastLabel.FlatStyle = FlatStyle.System;
            this.MulticastLabel.Font      = Model.Viewer.ViewerStateModel.StringFont2;
            this.MulticastLabel.Location  = new Point(10, (int)(2 * this.MulticastLabel.Font.Height));
            this.MulticastLabel.Size      = new Size(this.Width - 20, this.MulticastLabel.Font.Height);
            this.Controls.Add(this.MulticastLabel);
#else
            this.UnicastLabel.Location = new Point(10, label1.Bottom + 5);
#endif



            //Add the TCP dealie to the list
            bool isInstructor = false;
            using (Synchronizer.Lock(this.m_Model.Participant.SyncRoot)) {
                isInstructor = (this.m_Model.Participant.Role is InstructorModel);
            }
            if (!isInstructor)
            {
                this.TCPRadioButton = new ConnectTCPRadioButton(m_EventQueue, m_Model, this,
                                                                new Point(10, this.UnicastLabel.Bottom + 5), this.Width - 60);
                this.Controls.Add(this.TCPRadioButton);//Add click handlers, etc
                this.Reenter          = new ReenterServerButton(this.TCPRadioButton);
                this.Reenter.Location = new Point(this.TCPRadioButton.Right, this.TCPRadioButton.Top);
                this.Reenter.Width    = 100;
                this.Controls.Add(this.Reenter);
            }

            // Set up a helper to add other classrooms
            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
Esempio n. 17
0
            public EnableExternalMonitorCheckbox(Point location, Size size, PresenterModel model, ControlEventQueue dispatcher, StartupForm parent)
            {
                this.SuspendLayout();

                this.m_Model = model;
                this.m_Parent = parent;
                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Font = Model.Viewer.ViewerStateModel.StringFont2;
                this.Size = size;
                this.Name = "enableSecondMonitorCheckBox";
                this.Text = Strings.EnableSecondMonitor;
                this.Enabled = false;
                // Set the default value according to the model's current setting
                // NOTE: Split into two steps to avoid deadlock with updating the check state
                bool bShouldBeChecked = true;

                if (this.m_Model != null) {
                    using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
                        bShouldBeChecked = this.m_Model.ViewerState.SecondMonitorEnabled;
                    }
                }

                if (bShouldBeChecked) {
                    this.Checked = true;
                    this.CheckState = CheckState.Checked;
                }
                else {
                    this.Checked = false;
                    this.CheckState = CheckState.Unchecked;
                }

                this.ResumeLayout();

                // Listen for changes to the Role property
                this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(dispatcher, new PropertyEventHandler(this.HandleRoleChanged));
                this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
                this.m_RoleChangedDispatcher.Dispatcher(this, null);

                this.m_SecondMonitorChangedDispatcher = new EventQueue.PropertyEventDispatcher(dispatcher, new PropertyEventHandler(this.HandleSecondMonitorChanged));
                this.m_Model.ViewerState.Changed["SecondMonitorEnabled"].Add(this.m_SecondMonitorChangedDispatcher.Dispatcher);
                this.m_SecondMonitorChangedDispatcher.Dispatcher(this, null);
            }
Esempio n. 18
0
 public ConnectionHelper(StartupForm stup, PresenterModel model, ControlEventQueue dispatcher)
 {
     this.m_StartupForm = stup;
     this.m_TabControl = this.m_StartupForm.m_TabControl;
     this.m_Model = model;
     this.m_EventQueue = dispatcher;
 }
Esempio n. 19
0
            public InstructorConnection(StartupForm parent, PresenterModel model, ControlEventQueue dispatcher)
                : base(parent, model, dispatcher)
            {
                this.m_PresentationsPanel = null;
                this.m_ManualConnectionPanel = new ManualConnectionPanel(this.m_Model, this.m_StartupForm);
                this.m_ManualConnectionPanel.Location = parent.m_UDPPanel.Location;
                this.m_ManualConnectionPanel.Size = parent.m_UDPPanel.Size;
                /*if (!(this.m_StartupForm.Controls.Contains(this.m_TabControl))) {
                    this.m_StartupForm.Controls.Add(this.m_TabControl);

                    }*/
                if (!(this.m_StartupForm.Controls.Contains(this.m_StartupForm.m_TabGroupBox))) {
                    this.m_StartupForm.Controls.Add(this.m_StartupForm.m_TabGroupBox);
                    if (!(this.m_StartupForm.m_TabGroupBox.Controls.Contains(this.m_TabControl))) {
                        this.m_StartupForm.m_TabGroupBox.Controls.Add(this.m_TabControl);
                    }
                }
                this.m_TabControl.m_AdvancedTab.Controls.Add(this.m_ManualConnectionPanel);
                if (this.m_TabControl.Controls.Contains(this.m_TabControl.m_UDPTab)) {
                    this.m_TabControl.Controls.Remove(this.m_TabControl.m_UDPTab);
                }
            }
Esempio n. 20
0
            public RoleGroup(Point location, Size size, PresenterModel model, StartupForm startup, bool compact)
            {
                int buttonSpacing = 5;
                int topSpacing    = 20;

                if (compact)
                {
                    buttonSpacing = 1;
                    topSpacing    = 10;
                }
                this.SuspendLayout();
                this.m_Model       = model;
                this.m_StartupForm = startup;
                this.FlatStyle     = FlatStyle.System;
                this.Location      = location;
                this.Size          = size;
                this.Name          = "RoleGroup";
                this.Text          = Strings.StartupStepOne;
                this.Enabled       = true;

                Label labelConnected = new Label();

                labelConnected.FlatStyle = FlatStyle.System;
                labelConnected.Text      = Strings.NetworkedMode;
                labelConnected.Font      = Model.Viewer.ViewerStateModel.StringFont2;
                labelConnected.Location  = new Point(20, topSpacing);
                labelConnected.Size      = new Size(120, 16);
                this.Controls.Add(labelConnected);

                Label labelDisconnected = new Label();

                labelDisconnected.FlatStyle = FlatStyle.System;
                labelDisconnected.Font      = Model.Viewer.ViewerStateModel.StringFont2;
                labelDisconnected.Text      = Strings.StandAloneMode;
                labelDisconnected.Location  = new Point(140, topSpacing);
                labelDisconnected.Size      = new Size(90, 16);
                this.Controls.Add(labelDisconnected);


                //Find a RadioButton constructor that does this stuff
                this.ViewerRadioButton                 = new RadioButton();
                this.ViewerRadioButton.FlatStyle       = FlatStyle.System;
                this.ViewerRadioButton.Font            = Model.Viewer.ViewerStateModel.StringFont1;
                this.ViewerRadioButton.Text            = Strings.StudentRole;
                this.ViewerRadioButton.Location        = new Point(20, labelConnected.Bottom + buttonSpacing);
                this.ViewerRadioButton.Size            = new Size(100, this.ViewerRadioButton.Font.Height);
                this.ViewerRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.ViewerRadioButton);

                this.PresenterRadioButton                 = new RadioButton();
                this.PresenterRadioButton.FlatStyle       = FlatStyle.System;
                this.PresenterRadioButton.Font            = Model.Viewer.ViewerStateModel.StringFont1;
                this.PresenterRadioButton.Text            = Strings.InstructorRole;
                this.PresenterRadioButton.Location        = new Point(20, ViewerRadioButton.Bottom + buttonSpacing);
                this.PresenterRadioButton.Size            = new Size(100, this.PresenterRadioButton.Font.Height);
                this.PresenterRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.PresenterRadioButton);


                this.PublicRadioButton                 = new RadioButton();
                this.PublicRadioButton.FlatStyle       = FlatStyle.System;
                this.PublicRadioButton.Font            = Model.Viewer.ViewerStateModel.StringFont1;
                this.PublicRadioButton.Text            = Strings.PublicDisplayRole;
                this.PublicRadioButton.Location        = new Point(20, PresenterRadioButton.Bottom + buttonSpacing);
                this.PublicRadioButton.Size            = new Size(140, this.PublicRadioButton.Font.Height);
                this.PublicRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.PublicRadioButton);

                this.DisconnectedRadioButton                 = new RadioButton();
                this.DisconnectedRadioButton.FlatStyle       = FlatStyle.System;
                this.DisconnectedRadioButton.Font            = Model.Viewer.ViewerStateModel.StringFont1;
                this.DisconnectedRadioButton.Text            = Strings.InstructorRole;
                this.DisconnectedRadioButton.Location        = new Point(140, labelDisconnected.Bottom + buttonSpacing);
                this.DisconnectedRadioButton.Size            = new Size(90, this.DisconnectedRadioButton.Font.Height);
                this.DisconnectedRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.DisconnectedRadioButton);
#if STUDENT_CLIENT_ONLY
                this.DisconnectedRadioButton.Enabled = false;
                this.PublicRadioButton.Enabled       = false;
                this.PresenterRadioButton.Enabled    = false;
#endif

                this.m_ViewerStateRoleListener = new EventQueue.PropertyEventDispatcher(this.m_StartupForm.m_EventQueue,
                                                                                        new PropertyEventHandler(this.HandleViewerStateRoleChanged));
                this.m_Model.ViewerState.Changed["iRole"].Add(this.m_ViewerStateRoleListener.Dispatcher);

                this.m_ViewerStateRoleListener.Dispatcher(this, null);

                this.ResumeLayout();
            }
Esempio n. 21
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.");

        }
Esempio n. 22
0
            public RoleGroup(Point location, Size size, PresenterModel model, StartupForm startup, bool compact)
            {
                int buttonSpacing = 5;
                int topSpacing = 20;
                if (compact) {
                    buttonSpacing = 1;
                    topSpacing = 10;
                }
                this.SuspendLayout();
                this.m_Model = model;
                this.m_StartupForm = startup;
                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.Name = "RoleGroup";
                this.Text = Strings.StartupStepOne;
                this.Enabled = true;

                Label labelConnected = new Label();
                labelConnected.FlatStyle = FlatStyle.System;
                labelConnected.Text = Strings.NetworkedMode;
                labelConnected.Font = Model.Viewer.ViewerStateModel.StringFont2;
                labelConnected.Location = new Point(20, topSpacing);
                labelConnected.Size = new Size(120, 16);
                this.Controls.Add(labelConnected);

                Label labelDisconnected = new Label();
                labelDisconnected.FlatStyle = FlatStyle.System;
                labelDisconnected.Font = Model.Viewer.ViewerStateModel.StringFont2;
                labelDisconnected.Text = Strings.StandAloneMode;
                labelDisconnected.Location = new Point(140, topSpacing);
                labelDisconnected.Size = new Size(90, 16);
                this.Controls.Add(labelDisconnected);

                //Find a RadioButton constructor that does this stuff
                this.ViewerRadioButton = new RadioButton();
                this.ViewerRadioButton.FlatStyle = FlatStyle.System;
                this.ViewerRadioButton.Font = Model.Viewer.ViewerStateModel.StringFont1;
                this.ViewerRadioButton.Text = Strings.StudentRole;
                this.ViewerRadioButton.Location = new Point(20, labelConnected.Bottom + buttonSpacing);
                this.ViewerRadioButton.Size = new Size(100, this.ViewerRadioButton.Font.Height);
                this.ViewerRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.ViewerRadioButton);

                this.PresenterRadioButton = new RadioButton();
                this.PresenterRadioButton.FlatStyle = FlatStyle.System;
                this.PresenterRadioButton.Font = Model.Viewer.ViewerStateModel.StringFont1;
                this.PresenterRadioButton.Text = Strings.InstructorRole;
                this.PresenterRadioButton.Location = new Point(20, ViewerRadioButton.Bottom + buttonSpacing);
                this.PresenterRadioButton.Size = new Size(100, this.PresenterRadioButton.Font.Height);
                this.PresenterRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.PresenterRadioButton);

                this.PublicRadioButton = new RadioButton();
                this.PublicRadioButton.FlatStyle = FlatStyle.System;
                this.PublicRadioButton.Font = Model.Viewer.ViewerStateModel.StringFont1;
                this.PublicRadioButton.Text = Strings.PublicDisplayRole;
                this.PublicRadioButton.Location = new Point(20, PresenterRadioButton.Bottom + buttonSpacing);
                this.PublicRadioButton.Size = new Size(140, this.PublicRadioButton.Font.Height);
                this.PublicRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.PublicRadioButton);

                this.DisconnectedRadioButton = new RadioButton();
                this.DisconnectedRadioButton.FlatStyle = FlatStyle.System;
                this.DisconnectedRadioButton.Font = Model.Viewer.ViewerStateModel.StringFont1;
                this.DisconnectedRadioButton.Text = Strings.InstructorRole;
                this.DisconnectedRadioButton.Location = new Point(140, labelDisconnected.Bottom + buttonSpacing);
                this.DisconnectedRadioButton.Size = new Size(90, this.DisconnectedRadioButton.Font.Height);
                this.DisconnectedRadioButton.CheckedChanged += new EventHandler(OnCheckedChanged);
                this.Controls.Add(this.DisconnectedRadioButton);
                #if STUDENT_CLIENT_ONLY
                this.DisconnectedRadioButton.Enabled = false;
                this.PublicRadioButton.Enabled = false;
                this.PresenterRadioButton.Enabled = false;
                #endif

                this.m_ViewerStateRoleListener = new EventQueue.PropertyEventDispatcher(this.m_StartupForm.m_EventQueue,
                    new PropertyEventHandler(this.HandleViewerStateRoleChanged));
                this.m_Model.ViewerState.Changed["iRole"].Add(this.m_ViewerStateRoleListener.Dispatcher);

                this.m_ViewerStateRoleListener.Dispatcher(this, null);

                this.ResumeLayout();
            }
Esempio n. 23
0
        public PresentationsPanel(PresenterModel model, StartupForm stup)
        {
            if (model == null)
                throw new ArgumentNullException("model");

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

            this.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.Location = new Point(276, 10);
            this.Size = new Size(250, 250);
            this.BorderStyle = BorderStyle.Fixed3D;
            this.AutoScroll = true;

            Label label = new Label();
            label.FlatStyle = FlatStyle.System;
            label.Font = Model.Viewer.ViewerStateModel.StringFont2;
            label.Size = new Size(this.Width + 30, label.Font.Height);
            label.Location = new Point(10, 5);
            label.Text = Strings.PresentationsInChosenVenue;
            this.Controls.Add(label);

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

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
        public ManualConnectionPanel(PresenterModel model, StartupForm stup)
        {
            if (model == null)
                throw new ArgumentNullException("model");

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

            //this.Text = "Manual Connections";
            this.Font = Model.Viewer.ViewerStateModel.StringFont;
            this.Location = new Point(10, 10);
            this.Size = new Size(250, 250);

            this.CreateHandle();

            this.BorderStyle = BorderStyle.Fixed3D;
            this.AutoScroll = true;

            Label label1 = new Label();
            label1.FlatStyle = FlatStyle.System;
            label1.Font = Model.Viewer.ViewerStateModel.StringFont2;
            label1.Text = Strings.ManualConnectionVenues;
            label1.Location = new Point(10, 5);
            label1.Size = new Size(this.Width - 20, label1.Font.Height);
            this.Controls.Add(label1);

            this.UnicastLabel = new Label();
            this.UnicastLabel.FlatStyle = FlatStyle.System;
            this.UnicastLabel.Font = Model.Viewer.ViewerStateModel.StringFont2;
            this.UnicastLabel.Text = Strings.Unicast;
            this.UnicastLabel.Location = new Point(10, (int)(10*this.UnicastLabel.Font.Height) + 5);
            this.UnicastLabel.Size = new Size(this.Width - 20, this.UnicastLabel.Font.Height);
            this.Controls.Add(this.UnicastLabel);

            #if RTP_BUILD
            this.MulticastLabel = new Label();
            this.MulticastLabel.Text = Strings.MultiCast;
            this.MulticastLabel.FlatStyle = FlatStyle.System;
            this.MulticastLabel.Font = Model.Viewer.ViewerStateModel.StringFont2;
            this.MulticastLabel.Location = new Point(10, (int)(2 * this.MulticastLabel.Font.Height));
            this.MulticastLabel.Size = new Size(this.Width - 20, this.MulticastLabel.Font.Height);
            this.Controls.Add(this.MulticastLabel);

            #else
            this.UnicastLabel.Location = new Point(10, label1.Bottom + 5);

            #endif

            //Add the TCP dealie to the list
            bool isInstructor = false;
            using (Synchronizer.Lock(this.m_Model.Participant.SyncRoot)) {
                   isInstructor = (this.m_Model.Participant.Role is InstructorModel);
            }
            if (!isInstructor) {
                this.TCPRadioButton = new ConnectTCPRadioButton(m_EventQueue, m_Model, this,
                    new Point(10, this.UnicastLabel.Bottom + 5), this.Width - 60);
                this.Controls.Add(this.TCPRadioButton);//Add click handlers, etc
                this.Reenter = new ReenterServerButton(this.TCPRadioButton);
                this.Reenter.Location = new Point(this.TCPRadioButton.Right, this.TCPRadioButton.Top);
                this.Controls.Add(this.Reenter);
            }

            // Set up a helper to add other classrooms
            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
Esempio n. 25
0
            public StartupTabControl(Size size, Point location, int tabIndex, StartupForm stup, PresenterModel model, ControlEventQueue eventqueue)
            {
                this.SuspendLayout();
                this.m_Startup = stup;
                this.m_Model = model;
                this.ItemSize = new System.Drawing.Size(52, 18);
                this.Location = location;
                this.Name = "tabControl";
                this.SelectedIndex = 0;
                this.Font = Model.Viewer.ViewerStateModel.StringFont;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.m_AdvancedTab = new AdvancedTab(this.m_Model);
                this.m_UDPTab = new UDPTab(this.m_Model);
                this.m_UDPTab.Controls.Add(this.m_Startup.m_UDPPanel);
                this.Controls.Add(this.m_UDPTab);
                this.Controls.Add(this.m_AdvancedTab);

                this.m_AdvancedListener = new EventQueue.PropertyEventDispatcher(
                    this.m_Startup.m_EventQueue,
                    new PropertyEventHandler(this.HandleAdvancedChanged));
                this.m_Model.ViewerState.Changed["Advanced"].Add(this.m_AdvancedListener.Dispatcher);
                this.m_AdvancedListener.Dispatcher(this, null);

                this.ControlAdded += new ControlEventHandler(UDPTabAdded);

                this.ResumeLayout();
            }