public bool Login () { if (this.username.Length == 0 | this.password.Length == 0) { throw new SmugMugException("There is no username or password."); } if (this.connected == false && this.credentials.UserID == 0) { try { this.credentials = SmugMugProxy.LoginWithPassword (this.username, this.password); this.connected = true; } catch { return false; } } else { LoginWithHash (); } return true; }
public void Logout() { if (!connected) return; if (this.credentials.SessionID == null && this.credentials.SessionID.Length == 0) return; SmugMugProxy.Logout (this.credentials.SessionID); connected = false; this.credentials = new Credentials (null, 0, null); }