Beispiel #1
0
        } // end of method

        #endregion IHelloAuthenticate Implementation

        #region Methods

        /// <summary>
        /// SendMessageToUsers
        /// Sends a message to all logged in users
        /// </summary>
        /// <param name="message">(string) message to user</param>
        private void SendMessageToUsers(string message)
        {
            // Sens message for each logged in user
            foreach (User user in LoggedInUsers)
            {
                try
                {
                    IServiceCallback callback = user.Callback;
                    callback.SendClientMessage(message);
                }

                // Catches an issue with a user disconnect and logs off that user
                catch (Exception)
                {
                    // Remove the disconnected client
                    LogOff(user.UserName);
                }
            } // end of foreach
        }     // end of method