Esempio n. 1
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 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);
        }
Esempio n. 3
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 ManualConnectionMenu(ControlEventQueue dispatcher, PresenterModel model, PresentationsMenu pm)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model      = model;
            this.Text         = "&Manual Connection";

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, pm, this.m_Model.Network);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
        /// <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);
        }
        public PresentationsListView(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 presentations.
            // In the mean time, this servers 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);

            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 = "Presentations";
            this.Columns[1].Text = "Instructor";
            this.Columns[2].Text = "Participants";

            // 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
            this.Items.Add( new ListViewItem( "New Presentation" ) );
            this.Items[this.Items.Count - 1].Selected = true;

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
        }
Esempio n. 8
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);
        }
Esempio n. 9
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 ManualConnectionMenu(ControlEventQueue dispatcher, PresenterModel model, PresentationsMenu pm)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.Text = "&Manual Connection";

            this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, pm, this.m_Model.Network);
        }
Esempio n. 10
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. 12
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);
        }