private void SessionLeave(USession sees) { Sessions.Remove(sees); OnSessionLeave?.Invoke(sees); if (Sessions.Count < 1) { OnUserLeave?.Invoke(this); } }
public void AddSession(USession sess) { if (Sessions.FirstOrDefault((x) => x.Callback == sess.Callback) == null) { sess.OnLeave += SessionLeave; Sessions.Add(sess); sess.Callback.RLogin(new RUser(BaseUser, true)); Console.WriteLine("SLogin: " + BaseUser.Login); } }