Пример #1
0
 internal LoggedOutEventArgs(LogoutReason reason, ConnectionErrorException connectionError)
 {
     Reason = reason;
     ConnectionError = connectionError;
 }
Пример #2
0
        void LogoutInner(LogoutReason reason, ConnectionErrorException connectionError)
        {

            if (!IsLoggedIn)
                return;

            connection.Error -= connection_Error;

            commandsDisposable.Dispose();

            connection.Close();

            reader = null;
            writer = null;
            connection = null;
            responseTracker = null;

            var statusChangeEvents = new List<UserStatusEventArgs>();

            foreach (User user in UserLists.ForwardList.Users.Where(u => u.Status != UserStatus.Offline))
            {
                UserStatus prevStatus = user.Status;
                user.Status = UserStatus.Offline;
                statusChangeEvents.Add(new UserStatusEventArgs(user, UserStatus.Offline, prevStatus, false));
            }

            IsLoggedIn = false;

            OnLoggedOut(new LoggedOutEventArgs(reason, connectionError));

            foreach (UserStatusEventArgs e in statusChangeEvents)
                OnUserStatusChanged(e);

        }
Пример #3
0
 internal ConnectionErrorEventArgs(ConnectionErrorException exception)
 {
     Exception = exception;
 }