Exemplo n.º 1
0
		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;
		}
Exemplo n.º 2
0
        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);
        }