Пример #1
0
 /// <summary>
 /// When a communicator connects to server, this method is called.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event args</param>
 private void Manager_CommunicatorConnected(object sender, CommunicatorConnectedEventArgs e)
 {
     e.Communicator.StateChanged += Communicator_StateChanged;
     AddToCommunicators(e.Communicator);
     e.Communicator.MessageReceived += Communicator_MessageReceived;
     e.Communicator.Start();
 }
Пример #2
0
        /// <summary>
        /// Handles CommunicatorConnected event of all client applications.
        /// </summary>
        /// <param name="sender">Creates of event (application)</param>
        /// <param name="e">Event arguments</param>
        private void ClientApplication_CommunicatorConnected(object sender, CommunicatorConnectedEventArgs e)
        {
            var application = sender as MDSRemoteApplication;

            if (application == null)
            {
                return;
            }

            SendMessageToAllReceivers(new ClientApplicationRefreshEventMessage
            {
                Name = application.Name,
                CommunicatorCount = application.ConnectedCommunicatorCount
            });
        }