示例#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));
        }
        public SaveAllDecksMenuItem(PresenterModel model, DeckMarshalService marshal)
        {
            this.m_Model = model;
            this.m_SaveDeckDialog = new SaveDeckDialog(model, marshal);

            this.Text = Strings.SaveAllDecks;
        }
        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);
        }
示例#4
0
        /// <summary>
        /// Construct the dialog box
        /// </summary>
        /// <param name="model"></param>
        public DeckMatcherForm( PresenterModel model )
        {
            this.m_Model = model;

            // Setup the form UI
            this.SuspendLayout();

            this.ClientSize = new Size( 400, 500 );
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "DeckMatcherForm";
            this.Text = "Deck Matcher";

            // Add the controls
            this.Controls.Add( new DeckMatcherDoneButton( new Point(313, 470), 0 ) );
            this.m_UnmatchedControls = new UnmatchedGroupBox( this, new Point(10, 10), new Size(380,260), 1 );
            this.Controls.Add( this.m_UnmatchedControls );
            this.m_MatchedControls = new MatchedGroupBox( this, new Point(10, 280), new Size(380,180), 2 );
            this.Controls.Add( this.m_MatchedControls );

            this.ResumeLayout();

            // Populate the form...
            this.RefreshLists();
        }
示例#5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">The model that this component modifies</param>
        public MainToolBar(PresenterModel model, ControlEventQueue dispatcher)
        {
            // Initialize private variables
            this.m_EventQueue = dispatcher;
            this.m_Model = model;

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

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

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

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

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

            this.ResumeLayout();
        }
示例#6
0
        public EditMenu(ControlEventQueue dispatcher, PresenterModel model)
        {
            this.Text = Strings.Edit;

            this.MenuItems.Add(new UndoMenuItem(dispatcher, model));
            this.MenuItems.Add(new RedoMenuItem(dispatcher, model));
        }
示例#7
0
 public RedoMenuItem(ControlEventQueue dispatcher, PresenterModel model)
     : base(dispatcher, model)
 {
     this.Text = Strings.Redo;
     this.Shortcut = Shortcut.CtrlY;
     this.ShowShortcut = true;
 }
示例#8
0
        public static void StartEmptyPresentation( PresenterModel model )
        {
            // Make sure we have a suitable RoleModel for broadcasting a presentation.
            InstructorModel instructor;
            using(Synchronizer.Lock(model.Participant.SyncRoot)) {
                instructor = model.Participant.Role as InstructorModel;
                if(instructor == null) {
                    // Make the participant representing this user an Instructor,
                    // which tells the ConnectionManager to broadcast the presentation
                    // once it's added to the classroom.
                    instructor = new InstructorModel(Guid.NewGuid());
                    model.Participant.Role = instructor;
                }
            }

            // Create the presentation.
            // TODO: Find something useful to use as the Presentation's HumanName.
            PresentationModel pres = new PresentationModel(Guid.NewGuid(), model.Participant, "Untitled Presentation",true);

            using(Synchronizer.Lock(model.Network.SyncRoot)) {
                // Associate the participant with itself.  This removes any existing association
                // (since an Instructor should not be processing broadcasts from other clients),
                // and also causes the NetworkAssociationService to copy anything we do to the
                // InstructorModel to the WorkspaceModel.
                model.Network.Association = model.Participant;
            }

            // Here's the kicker, which triggers the viewer to hide the classroom browser
            // and start displaying the presentation.  The NetworkAssociationService copies
            // the presentation to the WorkspaceModel, which causes it to be displayed by the UI.
            using(Synchronizer.Lock(instructor.SyncRoot)) {
                instructor.CurrentPresentation = pres;
            }
        }
        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);
        }
        public TCPMessageReceiver(ITCPReceiver receiver, PresenterModel model, ClassroomModel classroom)
        {
            this.m_Model = model;
            this.m_Classroom = classroom;
            this.m_Receiver = receiver;
            this.m_Assembler = new ChunkAssembler();

            #if RTP_BUILD
            //If we are in the public role and the receiver enabled the client-side bridge, start the bridge.
            bool isPublicRole = false;
            using (Synchronizer.Lock(m_Model.SyncRoot)) {
                using (Synchronizer.Lock(m_Model.Participant.SyncRoot)) {
                    if (m_Model.Participant.Role is PublicModel) {
                        isPublicRole = true;
                    }
                }
            }
            if ((isPublicRole) && (receiver is TCPClient) && ((TCPClient)receiver).BridgeEnabled) {
                m_U2MBridge = new ClientUnicastToMulticastBridge(m_Model);
            }
            #endif
            this.m_Queue = new MessageProcessingQueue(this);

            Thread thread = new Thread(new ThreadStart(this.ReceiveThread));
            thread.Name = "TCPMessageReceiver";
            thread.Start();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sender">The network queue to send messages on</param>
        /// <param name="model">The presenter model</param>
        public StudentSubmissionNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.m_Sender = sender;
            this.m_Model = model;
            this.m_SendingLock = false;
            this.m_SendingLockTimer = new System.Timers.Timer();
            if (model.ViewerState != null)
            {
                using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot))
                {
                    this.m_SendingLockTimer.Interval = this.m_Model.ViewerState.StudentSubmissionInterval*1000;
                }
            }
            this.m_SendingLockTimer.Elapsed += new System.Timers.ElapsedEventHandler(SendingLockTimer_Elapsed);
            this.m_SendingLockTimer.Enabled = false;

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

            //FV: Not locking here resolves a lock order warning.
            //using( Synchronizer.Lock( this.m_Model.ViewerState.SyncRoot ) ) {
                this.m_Model.ViewerState.Changed["StudentSubmissionSignal"].Add( this.m_SendChangeDispatcher.Dispatcher );
            //}

            this.m_SubmissionIntervalDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSubmissionIntervalChanged));
            this.m_Model.ViewerState.Changed["StudentSubmissionInterval"].Add(this.m_SubmissionIntervalDispatcher.Dispatcher);
        }
        public LinkedDeckTraversalModel(EventQueue dispatcher, Guid id, PresenterModel model, DeckTraversalModel linked)
            : base(id, linked.Deck)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Linked = linked;
            // TODO: Evaluate whether we need to support other types of DeckTraversalModels.
            this.m_Unlinked = new SlideDeckTraversalModel(Guid.NewGuid(), linked.Deck);

            this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentChanged));
            this.m_NextChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNextChanged));
            this.m_PreviousChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandlePreviousChanged));
            this.m_AbsoluteCurrentSlideIndexChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleAbsoluteCurrentSlideIndexChanged));

            // Set this.m_Active and register event listeners via UpdateMode.
            this.m_Mode = DeckTraversalSelector.Linked;
            this.UpdateMode(DeckTraversalSelector.Linked);

            // Since UpdateMode doesn't initialize the event listeners like the Mode setter does, we must do this.
            this.m_CurrentChangedDispatcher.Dispatcher(this, null);
            this.m_NextChangedDispatcher.Dispatcher(this, null);
            this.m_PreviousChangedDispatcher.Dispatcher(this, null);
            this.m_AbsoluteCurrentSlideIndexChangedDispatcher.Dispatcher(this, null);

            // Watch for changes to the current network association.
            // When we're associated with an Instructor, we must obey its ForcingStudentNavigationLock policy.
            this.m_NetworkAssociationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationChanged));
            this.m_NetworkAssociationRoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationRoleChanged));
            this.m_ForcingStudentNavigationLockChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleForcingStudentNavigationLockChanged));
            this.m_Model.Network.Changed["Association"].Add(this.m_NetworkAssociationChangedDispatcher.Dispatcher);
            this.m_NetworkAssociationChangedDispatcher.Dispatcher(this, null);
        }
        public PresenterNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.m_Sender = sender;
            this.m_Model = model;

            this.m_ParticipantNetworkService = new ParticipantNetworkService(this.m_Sender, this.m_Model, this.m_Model.Participant);
            this.m_VersionExchangeNetworkService = new VersionExchangeNetworkService(m_Sender);
        }
示例#14
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 /// <param name="model">The PresenterModel to operate on</param>
 public DiagnosticsMenuItem( PresenterModel model )
 {
     localModel = model;
     this.Text = "Diagnostics";
     this.MenuItems.Add( new SaveLogMenuItem( model ) );
     this.MenuItems.Add( new MenuItem( "-" ) );
     this.MenuItems.Add( new StartPingMenuItem( model ) );
 }
示例#15
0
 public FilmStripAlignmentMenu(ControlEventQueue dispatcher, PresenterModel model)
     : base(Strings.FilmStripAlignment)
 {
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Left, Strings.Left));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Right, Strings.Right));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Top, Strings.Top));
     this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Bottom, Strings.Bottom));
 }
示例#16
0
        public RTPMessageSender(IPEndPoint ep, PresenterModel model, ClassroomModel classroom)
        {
            this.m_Model = model;
            this.m_Classroom = classroom;

            this.m_RtpLocalParticipant = new RtpLocalParticipant(this.m_Model.Participant);

            using(Synchronizer.Lock(this)) {
                // Register the stream event listeners first, since otherwise there would be a chance
                // that streams could be added between creating the RtpSession (which connects immediately).
                this.m_ParticipantManager = new ParticipantManager(this);

                this.m_RtpSession = new RtpSession(ep, this.m_RtpLocalParticipant, true, true);

                // TODO: Choose a meaningful value for the RtpSender name.
                ushort fec;
                short interpacketdelay;
                using (Synchronizer.Lock(model.SyncRoot)) {
                    using (Synchronizer.Lock(model.ViewerState.SyncRoot)) {
                        fec = (ushort)model.ViewerState.ForwardErrorCorrection;
                        interpacketdelay = (short)model.ViewerState.InterPacketDelay;
                    }
                }
                if( fec == 0 )
                    this.m_RtpSender = this.m_RtpSession.CreateRtpSender( "Classroom Presenter", PayloadType.dynamicPresentation, null );
                else
                    this.m_RtpSender = this.m_RtpSession.CreateRtpSenderFec( "Classroom Presenter", PayloadType.dynamicPresentation, null, 0, fec );
                this.m_RtpSender.DelayBetweenPackets = interpacketdelay;

                // Initialize the message chunking utilities.
                this.m_Encoder = new Chunk.ChunkEncoder();
                // TODO: Make the buffer size dynamic, ie., grow if we send a single very large message.
                // Make the buffer store up to 5MB worth of data.
                this.m_FrameBuffer = new FrameBuffer(5 * 1024 * 1024 / this.m_Encoder.MaximumChunkSize);

                // Create the NackManager which is responsible for sending NACKs on behalf of
                // our set of RTPMessageReceivers.
                this.m_NackManager = new RTPNackManager(this, this.m_Classroom);
            }

            // Create network services outside of the "lock(this)" so they can lock their own objects
            // without worrying about locking order.

            // Create the PresenterNetworkService which will watch for changes to the model and send messages.
            this.m_PresenterNetworkService = new PresenterNetworkService(this, this.m_Model);

            // Create the StudentSubmissionsNetworkService which will watch for requests to submit and send messages.
            this.m_StudentSubmissionNetworkService = new StudentSubmissionNetworkService(this, this.m_Model);

            // Create the SynchronizationNetworkService which will watch for all synchronization messages.
            this.m_SynchronizationNetworkService = new SynchronizationNetworkService( this, this.m_Model );

            // Create the ScriptingNetworkService which will watch for all scripting messages.
            this.m_ScriptingNetworkService = new ScriptingNetworkService( this, this.m_Model );

            // Create the BeaconService which will broadcast periodic information about the presentation.
            this.m_BeaconService = new Beacons.DefaultBeaconService(this, this.m_Model);
        }
        /// <summary>
        /// Construction for Form
        /// </summary>
        public BackgroundPropertiesForm(PresenterModel model)
        {
            this.m_Model = model;

            this.SuspendLayout();
            this.ClientSize = new Size(320, 320);
            this.Font = ViewerStateModel.FormFont;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.Name = "BackgroundPropertiesForm";
            this.Text = Strings.BackgroundPropertiesFormTitle;

            //Get the BackgroundTemplate Model
            using (this.m_Model.Workspace.Lock())
            {
                DeckTraversalModel traversal = this.m_Model.Workspace.CurrentDeckTraversal;
                if (traversal != null)
                {
                    using (Synchronizer.Lock(traversal.SyncRoot))
                    {
                        if (this.m_ApplyToCurrentSlideOnly)
                        {
                            SlideModel current = traversal.Current.Slide;
                            if (current != null)
                            {
                                using (Synchronizer.Lock(traversal.Current.Slide.SyncRoot))
                                {
                                    if (traversal.Current.Slide.BackgroundTemplate != null)
                                    {
                                        this.m_Template = traversal.Current.Slide.BackgroundTemplate.Clone();
                                    }
                                }
                            }
                        }
                        else
                        {
                            DeckModel deck = traversal.Deck;
                            using (Synchronizer.Lock(deck.SyncRoot))
                            {
                                if (deck.DeckBackgroundTemplate != null)
                                    this.m_Template = deck.DeckBackgroundTemplate.Clone();
                            }
                        }
                    }
                }
            }

            this.m_BkgTemplateSelectionGroup = new BkgTemplateSelectionGroup(this, this.m_Template, new Point(20, 10), new Size(280, 50), 0);
            this.Controls.Add(this.m_BkgTemplateSelectionGroup);

            this.m_BkgTemplatePreviewGroup = new BkgTemplatePreviewGroup(this, new Point(20, 70), new Size(280, 210), 1);
            this.Controls.Add(this.m_BkgTemplatePreviewGroup);

            this.Controls.Add(new PropertiesOKButton(this, this.m_Model, new Point(80, 285), 2));
            this.Controls.Add(new PropertiesCancelButton(this, this.m_Model, this.m_Template, new Point(180, 285), 3));

            this.ResumeLayout();
        }
 public TCPClientClassroomManager(PresenterModel model, TCPConnectionManager connection, 
     InstructorAdvertisement instructorAdvertisement)
 {
     this.m_InstructorAdvertisement = instructorAdvertisement;
     this.m_Model = model;
     this.m_ClientConnected = false;
     this.m_Classroom = new ClassroomModel(connection.Protocol, m_InstructorAdvertisement.HumanName, ClassroomModelType.Dynamic);
     this.m_Classroom.Changing["Connected"].Add(new PropertyEventHandler(this.HandleConnectedChanging));
 }
示例#19
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;
        }
        public TCPClassroomManager(PresenterModel model, TCPConnectionManager connection, string humanName)
        {
            this.m_Model = model;
            this.m_ClientConnected = false;
            this.m_ServerStarted = false;
            this.m_ServerEP = null;

            this.m_Classroom = new ClassroomModel(connection.Protocol, humanName, ClassroomModelType.TCPStatic);
            this.m_Classroom.Changing["Connected"].Add(new PropertyEventHandler(this.HandleConnectedChanging));
        }
        /// <summary>
        /// Constructor for the scripting network service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="model"></param>
        /// <param name="diag"></param>
        public ScriptingNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.Sender = sender;
            this.m_Model = model;
            this.m_Diagnostic = model.ViewerState.Diagnostic;

            // Set up the change listeners
            this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleGenericChange));
            this.m_Diagnostic.Changed["ExecuteRemoteScript"].Add(this.m_GenericChangeDispatcher.Dispatcher);
        }
示例#22
0
        //public BroadcastSender(BroadcastMessage message) {
        public BroadcastSender(IPEndPoint serverEP, PresenterModel model, Guid serverID)
        {
            m_ServerEP = serverEP;
            m_Model = model;
            m_ServerID = serverID;
            m_Presentation = null;
            m_PresentationName = "Untitled Presentation";
            m_BufferSyncObject = new object();

            //The user can manually disable the broadcast for security/privacy reasons.
            m_Model.ViewerState.Changed["BroadcastDisabled"].Add(new PropertyEventHandler(OnBroadcastDisabledChanged));
            using (Synchronizer.Lock(m_Model.ViewerState.SyncRoot)) {
                m_BroadcastDisabled = m_Model.ViewerState.BroadcastDisabled;
            }

            //Get the initial Participant name. This probably never changes.
            m_Model.Participant.Changed["HumanName"].Add(new PropertyEventHandler(OnParticipantNameChanged));
            using (Synchronizer.Lock(m_Model.Participant.SyncRoot)) {
                m_ParticipantName = m_Model.Participant.HumanName;
            }

            m_Model.ViewerState.Changed["ShowIP"].Add(new PropertyEventHandler(OnShowIPChanged));
            using (Synchronizer.Lock(m_Model.ViewerState.SyncRoot)) {
               this.m_showIP = m_Model.ViewerState.ShowIP;
            }

            //Construct an initial broadcast message.
            UpdateMessage();

            //When OnPresentationChange occurs we will update the broadcast message and subscribe the HumanName property of the new
            //PresentationModel.  When the PresentationModel.HumanName changes we will also update the broadcast message.
            ThreadEventQueue eventQueue = new ThreadEventQueue();
            this.m_CurrentPresentationChangedDispatcher = this.m_Model.Workspace.CurrentPresentation.ListenAndInitialize(eventQueue, OnPresentationChanged);

            m_LocalAddress = GetLocalAddress();

            initSocket();

            //if init failed..
            if (m_Socket == null) {
                return;
            }

            /// Sending to either broadcast address works.  Probably we prefer IPAddress.Broadcast
            /// because this way one broadcast works for multiple interfaces, and it should
            /// also work on IPv6 networks.
            IPAddress broadcast = IPAddress.Broadcast; //this is 255.255.255.255 for ipv4.
            if (BroadcastManager.UseIPv6) {
                broadcast = BroadcastManager.IPv6LinkLocalMulticast;
            }
            m_BroadcastEP = new IPEndPoint(broadcast, BroadcastSender.ListenPort);

            m_SendThread = new Thread(new ThreadStart(SendThread));
            m_SendThread.Start();
        }
        public FilmStripContextMenu(DeckTraversalModel traversal, PresenterModel model)
        {
            this.m_Model = model;
            this.m_DeckTraversal = traversal;

            this.MenuItems.Add(new InsertSlideMenuItem(m_DeckTraversal, this.m_Model));
            this.MenuItems.Add(new DuplicateSlideMenuItem(m_DeckTraversal, this.m_Model));
            this.MenuItems.Add(new PublicSlideMenuItem(m_DeckTraversal, this.m_Model));
            this.MenuItems.Add(new InsertSlidesFromFileMenuItem(m_DeckTraversal, this.m_Model));
            this.MenuItems.Add(new RemoveSlideMenuItem(m_DeckTraversal, this.m_Model));
        }
示例#24
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());
 }
        public StylusInputSelector(PresenterModel model, RealTimeStylus rts)
        {
            this.m_Model = model;
            this.m_RealTimeStylus = rts;

            this.m_Model.Changed["Stylus"].Add(new PropertyEventHandler(this.HandleStylusChanged));

            using(Synchronizer.Lock(this.m_Model)) {
                this.HandleStylusChanged(this.m_Model, null);
            }
        }
示例#26
0
            public DockMenuItem(ControlEventQueue dispatcher, PresenterModel model, DockStyle dock, string text)
                : base(text)
            {
                this.m_Model = model;
                this.m_DockStyle = dock;

                this.m_FilmStripAlignmentListener = new EventQueue.PropertyEventDispatcher(dispatcher,
                    new PropertyEventHandler(this.HandleFilmStripAlignmentChanged));
                this.m_Model.ViewerState.Changed["FilmStripAlignment"].Add(this.m_FilmStripAlignmentListener.Dispatcher);
                this.m_FilmStripAlignmentListener.Dispatcher(this, null);
            }
        public TCPConnectionManager(PresenterModel model)
        {
            this.m_Model = model;
            this.m_Protocol = new ProtocolModel(this, "TCP");

            this.m_Classroom = new TCPClassroomManager(this.m_Model, this, Strings.InstructorStartTCPServer);

            using (Synchronizer.Lock(this.m_Protocol.SyncRoot)) {
                this.m_Protocol.Classrooms.Add(this.m_Classroom.Classroom);
            }
        }
        public PreviewTraversalModelAdapter(ControlEventQueue dispatcher, SlideViewer viewer, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Model = model;
            this.m_Viewer = viewer;

            this.m_CurrentSlidePreviewDeckTraversalChangedDispatcher =
                this.m_Model.Workspace.CurrentSlidePreviewDeckTraversal.ListenAndInitialize(dispatcher,
                delegate(Property<DeckTraversalModel>.EventArgs args) {
                    this.CurrentSlidePreviewDeckTraversal = args.New;
                });
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dispatcher">The event queue</param>
        /// <param name="stylus">The stylus model</param>
        /// <param name="model">The presenter model</param>
        public StylusToolBarButton(ControlEventQueue dispatcher, StylusModel stylus, PresenterModel model)
        {
            this.m_EventQueue = dispatcher;
            this.m_Stylus = stylus;
            this.m_Model = model;

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

            // Initialize the Pushed state.
            this.m_StylusChangedDispatcher.Dispatcher(null, null);
        }
        public ParticipantNetworkService(SendingQueue sender, PresenterModel model, ParticipantModel participant)
        {
            this.m_Sender = sender;
            this.m_Model = model;
            this.m_Participant = participant;

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

            this.m_GroupCollectionHelper = new GroupCollectionHelper(this);
        }
示例#31
0
 public PresenterModel()
 {
     this.m_Stylus          = null;
     this.m_CurrentResult   = null;
     this.m_Network         = new NetworkModel();
     this.m_VersionExchange = new VersionExchangeModel();
     /// Note: We currently assume that the ParticipantModel Guid will be different for each application invocation.
     /// (In particular TCP reconnection relies on this assumption.)  If we need an identifer that persists across
     /// sessions, we'd need to create a new identifier for this.
     ParticipantId      = Guid.NewGuid();
     this.m_Participant = new ParticipantModel(ParticipantId, System.Windows.Forms.SystemInformation.UserName);
     this.m_Workspace   = new WorkspaceModel();
     this.m_Undo        = new UndoModel();
     this.m_ViewerState = new ViewerStateModel();
     this.m_PenState    = new PenStateModel();
     TheInstance        = this;
 }