示例#1
0
        private void OnLoginChange()
        {
            if (OnlineChanged != null)
            {
                Delegate[] invkList = OnlineChanged.GetInvocationList();
                Console.WriteLine("[Authentication] Notifying {0} Clients", invkList.Length);

                foreach (OnlineHandler handler in invkList)
                {
                    new Thread(() =>
                    {
                        try
                        {
                            handler(GetOnline());
                        }
                        catch (Exception)
                        {
                            OnlineChanged -= handler;
                        }
                    }).Start();
                }
            }
        }
示例#2
0
 public void Repeater(List <User> users)
 {
     OnlineChanged?.Invoke(users);
 }
 protected void OnOnlineChanged(bool status)
 {
     IsOnline = status;
     OnlineChanged?.Invoke(this, EventArgs.Empty);
 }
示例#4
0
 protected void OnOnlineChanged(bool status)
 {
     IsOnline = status;
     OnlineChanged?.Invoke(this, EventArgs.Empty);
     _logger.LogInformation("Status changed to {online}", status);
 }