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(); }
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); }
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); }
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)); }
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)); }
public CXPCapabilityMessageReceiver(CXPCapabilityMessageSender sender, uint ssrc, PresenterModel model, ClassroomModel classroom, ParticipantModel participant) { this.m_Model = model; this.m_Sender = sender; this.m_RemoteSSRC = ssrc; this.m_Context = new ReceiveContext(model, classroom, participant); this.m_ContextArgs = new object[] { this.m_Context }; this.m_Queue = new MessageProcessingQueue(this); this.m_Assembler = new ChunkAssembler(); this.m_Assembler.Nack += new ChunkAssembler.NackDelegate(this.HandleAssemblerNack); }
public RTPMessageReceiver(RTPMessageSender sender, RtpStream stream, PresenterModel model, ClassroomModel classroom, ParticipantModel participant) { this.m_Model = model; this.m_Sender = sender; this.m_RtpStream = stream; this.m_Context = new ReceiveContext(model, classroom, participant); this.m_ContextArgs = new object[] { this.m_Context }; this.m_Queue = new MessageProcessingQueue(this); this.m_Serializer = new BinaryFormatter(); this.m_Assembler = new ChunkAssembler(); this.m_Assembler.Nack += new ChunkAssembler.NackDelegate(this.HandleAssemblerNack); this.m_RtpStream.FrameReceived += new RtpStream.FrameReceivedEventHandler(this.HandleFrameReceived); }
public RTPClassroomManager(PresenterModel model, RTPConnectionManager connection, string humanName, IPEndPoint endPoint, bool advertisedClassroom) { this.m_Model = model; this.m_AdvertisedClassroom = advertisedClassroom; this.m_IPEndPoint = endPoint; ClassroomModelType classroomType = ClassroomModelType.RTPStatic; if (m_AdvertisedClassroom) { this.m_ClassroomName = humanName; classroomType = ClassroomModelType.Dynamic; } else { this.m_ClassroomName = humanName + " (" + m_IPEndPoint.Address.ToString() + ")"; } this.m_Classroom = new ClassroomModel(connection.Protocol, m_ClassroomName, classroomType); this.m_Classroom.RtpEndPoint = this.m_IPEndPoint; this.m_Classroom.Changing["Connected"].Add(new PropertyEventHandler(this.HandleConnectedChanging)); }
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); }
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); }
public TCPMessageSender(ITCPSender server, PresenterModel model, ClassroomModel classroom) { this.m_Model = model; this.m_Classroom = classroom; this.m_Sender = server; // Initialize the message chunking utilities. this.m_Encoder = new Chunk.ChunkEncoder(); // Most of the same services are created as in RTPMessageSender, with the exception // (for now, at least) that there is no BeaconService. // 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); }
public int IndexOf(ClassroomModel value) { return List.IndexOf(value); }
public RTPNackManager(IRTPMessageSender sender, ClassroomModel classroom) { this.m_Sender = sender; this.m_Classroom = classroom; this.m_Classroom.Changed["Participants"].Add(new PropertyEventHandler(this.HandleClassroomParticipantsChanged)); Thread thread = new Thread(new ThreadStart(this.FlusherThread)); thread.Name = "RTPNackManager.FlusherThread"; thread.IsBackground = true; thread.Start(); }
public ManualConnectionRadioButton(ControlEventQueue dispatcher, ClassroomModel classroom, ManualConnectionPanel parent, int i) { if (classroom == null) throw new ArgumentNullException("classroom", "The ClassroomModel associated with this ManualConnectionRadioButton cannot be null."); this.Font = Model.Viewer.ViewerStateModel.StringFont1; this.m_EventQueue = dispatcher; this.m_Classroom = classroom; this.Tag = classroom; this.Parent = parent; this.Parent.Controls.Add(this); this.index = i; int count = this.Parent.Controls.Count; #if RTP_BUILD this.Location = new Point(10, (int)(((ManualConnectionPanel)(this.Parent)).MulticastLabel.Bottom +5 + 1.5*this.Font.Height * (this.index))); #endif this.Size = new Size(this.Parent.Width-15, this.Font.Height); string classroomName = ""; using (Synchronizer.Lock(this.Classroom.SyncRoot)) { classroomName = this.Classroom.HumanName; } using (Synchronizer.Lock(((ManualConnectionPanel)(this.Parent)).m_Model.ViewerState.SyncRoot)) { if (classroomName == ((ManualConnectionPanel)(this.Parent)).m_Model.ViewerState.ManualConnectionButtonName) { this.Checked = true; } } if (classroomName == Strings.InstructorStartTCPServer) { this.Location = new Point(10, (int)(((ManualConnectionPanel)(this.Parent)).UnicastLabel.Bottom + 4 * this.Font.Height * (this.index))); this.Size = new Size(this.Parent.Width - 15, 3*this.Font.Height); //this.Location = new Point(10, 200 + 30 * (this.index)); //this.Size = new Size(180, 30); using (Synchronizer.Lock(((ManualConnectionPanel)(this.Parent)).m_Model.Participant.SyncRoot)) { if (!(((ManualConnectionPanel)(this.Parent)).m_Model.Participant.Role is InstructorModel)) { this.Visible = false; this.Enabled = false; } } } if (m_Classroom.ClassroomModelType == ClassroomModelType.Dynamic) { //Note the locations of the radio buttons for the advertised (Dynamic) classrooms are set by the ManualConnectionPanel.UpdateLayout method this.Size = new Size(this.Parent.Width - 20, 4 * this.Font.Height); //This is a hack... figure out why added more than once. bool isAlreadyAdded = false; int UDPControls = ((ManualConnectionPanel)this.Parent).m_Startup.m_UDPPanel.Controls.Count; for (int j = 0; j < UDPControls; j++) { if (((ManualConnectionPanel)this.Parent).m_Startup.m_UDPPanel.Controls[j].Text == classroomName) { isAlreadyAdded = true; } } if (!isAlreadyAdded) { ((ManualConnectionPanel)this.Parent).m_Startup.m_UDPPanel.Controls.Add(new UDPPresentationRadioButton(this.m_Classroom, ((ManualConnectionPanel)this.Parent).m_Startup, UDPControls, this.m_EventQueue)); ((ManualConnectionPanel)this.Parent).m_Startup.m_UDPPanel.UpdateLayout(); } using (Synchronizer.Lock(((ManualConnectionPanel)(this.Parent)).m_Model.Participant.SyncRoot)) { if (((ManualConnectionPanel)(this.Parent)).m_Model.Participant.Role is InstructorModel) { this.Visible = false; } } } //If the role changes we should disconnect from our classroom this.m_ViewerStateRoleListener = new EventQueue.PropertyEventDispatcher(((ManualConnectionPanel)(this.Parent)).m_EventQueue, new PropertyEventHandler(this.HandleViewerStateRoleChanged)); ((ManualConnectionPanel)(this.Parent)).m_Model.ViewerState.Changed["iRole"].Add(this.m_ViewerStateRoleListener.Dispatcher); this.m_HumanNameChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleHumanNameChanged)); this.Classroom.Changed["HumanName"].Add(this.m_HumanNameChangedDispatcher.Dispatcher); this.CheckedChanged += new EventHandler(HandleCheckedChanged); this.HandleHumanNameChanged(this.Classroom, null); }
public bool Contains(ClassroomModel value) { return(List.Contains(value)); }
public void Remove(ClassroomModel value) { List.Remove(value); }
public TCPServer(IPEndPoint localEP, PresenterModel model, ClassroomModel classroom, InstructorModel instructor) { string portStr = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".TCPListenPort"]; int p; if (Int32.TryParse(portStr, out p)) { TCPListenPort = p; } RestoreConfig(); m_ClientConnected = new ManualResetEvent(false); m_Participant = model.Participant; m_Classroom = classroom; m_ClientCount = 0; this.m_Network = model.Network; m_NetworkStatus = new NetworkStatus(ConnectionStatus.Disconnected, ConnectionProtocolType.TCP, TCPRole.Server, 0); this.m_Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus); if (localEP != null) { this.m_ListenEP = localEP; } else { IPAddress ip = IPAddress.Any; //Use IPv4 unless it is unavailable. TODO: Maybe this should be a configurable parameter? if ((!Socket.OSSupportsIPv4) && (Socket.OSSupportsIPv6)) { ip = IPAddress.IPv6Any; } this.m_ListenEP = new IPEndPoint(ip, TCPListenPort); } m_AllClients = new Hashtable(); m_ReceiveQueue = new Queue(); this.m_Encoder = new Chunk.ChunkEncoder(); this.m_ServerSender = new TCPServerSender(instructor); //Start bridging if config file says so #if RTP_BUILD m_U2MBridge = null; string enableBridge = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".EnableBridge"]; if (enableBridge != null) { bool enable = false; if (bool.TryParse(enableBridge, out enable) && enable) { Trace.WriteLine("Unicast to Multicast Bridge enabled.", this.GetType().ToString()); m_U2MBridge = new UnicastToMulticastBridge(model); } } #endif }
public int Add(ClassroomModel value) { return(List.Add(value)); }
public int Add(ClassroomModel value) { return List.Add(value); }
public PresentationCollectionHelper(ManualConnectionMenu mcm, PresentationsMenu parent, ClassroomModel classroom) : base(mcm.m_EventQueue, classroom, "Presentations") { this.m_Parent = parent; this.m_Classroom = classroom; this.m_ManualConnectionMenu = mcm; base.Initialize(); }
internal ReceiveContext(PresenterModel model, ClassroomModel classroom, ParticipantModel participant) { this.Model = model; this.Classroom = classroom; this.Participant = participant; }
public CXPCapabilityMessageSender(PresenterModel model, PresenterCapability capability) { this.m_Model = model; this.m_LocalId = m_Model.Participant.Guid; this.m_Classroom = new ClassroomModel(null, "CXP Capability Classroom", ClassroomModelType.CXPCapability); this.m_Capability = capability; this.m_Participants = new Dictionary<string, ParticipantModel>(); this.m_SsrcToSenderId = new Dictionary<uint, Guid>(); this.m_Receivers = new Dictionary<string, CXPCapabilityMessageReceiver>(); m_Capability.OnStreamAdded += new PresenterCapability.OnStreamAddedHandler(OnStreamAdded); m_Capability.OnStreamRemoved +=new PresenterCapability.OnStreamRemovedHandler(OnStreamRemoved); using(Synchronizer.Lock(this)) { // 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); // Report Network status to the UI m_CapabilityNetworkStatus = new CapabilityNetworkStatus(this.m_Model); m_CapabilityNetworkStatus.Register(); // Send an initial message to announce our node to others in the venue. SendObject(new CapabilityMessageWrapper(null, m_LocalId, Guid.Empty, m_Capability.IsSender)); }
public UDPPresentationCollectionHelper(UDPPresentationRadioButton parent, ClassroomModel classroom) : base(parent.m_EventQueue, classroom, "Presentations") { this.m_Parent = parent; base.Initialize(); }
public void Insert(int index, ClassroomModel value) { List.Insert(index, value); }
public bool Contains(ClassroomModel value) { return List.Contains(value); }
public PresentationCollectionHelper(PresentationsPanel parent, ClassroomModel classroom) : base(parent.m_EventQueue, classroom, "Presentations") { this.m_Parent = parent; this.m_Classroom = classroom; base.Initialize(); }
public int IndexOf(ClassroomModel value) { return(List.IndexOf(value)); }
public ClassroomMenuItem(ControlEventQueue dispatcher, PresenterModel model, ClassroomModel classroom) { this.m_EventQueue = dispatcher; this.m_Model = model; this.m_Classroom = classroom; this.m_HumanNameChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleHumanNameChanged)); this.m_ConnectedChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleConnectedChanged)); this.m_Classroom.Changed["HumanName"].Add(this.m_HumanNameChangedDispatcher.Dispatcher); this.m_Classroom.Changed["Connected"].Add(this.m_ConnectedChangedDispatcher.Dispatcher); this.m_HumanNameChangedDispatcher.Dispatcher(this, null); this.m_ConnectedChangedDispatcher.Dispatcher(this, null); }
public TCPServer(PresenterModel model, ClassroomModel classroom, InstructorModel instructor) : this(null,model,classroom,instructor) { }
public TCPServer(IPEndPoint localEP, PresenterModel model, ClassroomModel classroom, InstructorModel instructor) { RestoreConfig(); m_ClientConnected = new ManualResetEvent(false); m_Participant = model.Participant; m_Classroom = classroom; m_ClientCount = 0; this.m_Network = model.Network; m_NetworkStatus = new NetworkStatus(ConnectionStatus.Disconnected, ConnectionProtocolType.TCP, TCPRole.Server, 0); this.m_Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus); if (localEP != null) { this.m_ListenEP = localEP; } else { this.m_ListenEP = new IPEndPoint(IPAddress.Any, DefaultPort); } m_AllClients = new Hashtable(); m_ReceiveQueue = new Queue(); this.m_Encoder = new Chunk.ChunkEncoder(); this.m_ServerSender = new TCPServerSender(instructor); //Start bridging if config file says so #if RTP_BUILD m_U2MBridge = null; string enableBridge = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".EnableBridge"]; if (enableBridge != null) { bool enable = false; if (bool.TryParse(enableBridge, out enable) && enable) { Trace.WriteLine("Unicast to Multicast Bridge enabled.", this.GetType().ToString()); m_U2MBridge = new UnicastToMulticastBridge(model); } } #endif }
public ClassroomListViewItem(ControlEventQueue dispatcher, ClassroomModel classroom) { if(classroom == null) throw new ArgumentNullException("classroom", "The ClassroomModel associated with this ClassroomListViewItem cannot be null."); this.m_EventQueue = dispatcher; this.m_Classroom = classroom; this.Tag = classroom; this.m_HumanNameChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleHumanNameChanged)); this.m_ConnectedChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleConnectedChanged)); this.Classroom.Changed["HumanName"].Add(this.m_HumanNameChangedDispatcher.Dispatcher); this.Classroom.Changed["Connected"].Add(this.m_ConnectedChangedDispatcher.Dispatcher); this.SubItems.Add(this.m_ParticipantsSubItem = new ParticipantsSubItem(this)); this.SubItems.Add(this.m_ProtocolSubItem = new ProtocolSubItem(this)); this.HandleConnectedChanged(this.Classroom, null); this.HandleHumanNameChanged(this.Classroom, null); }