Ejemplo n.º 1
0
        /// <summary>
        /// When LogIn Button was clicked,
        /// Sending a log in Request to Facebook
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void stripBtn_LogIn_Click(object sender, EventArgs e)
        {
            m_LoginResult = FacebookService.Login(AppID, "user_photos, user_posts, user_friends, user_likes");

            if (!string.IsNullOrEmpty(m_LoginResult.AccessToken))
            {
                m_LoggedInUser = m_LoginResult.LoggedInUser;
                LoggedIn();
            }
            else
            {
                DialogResult input = MessageBox.Show(m_LoginResult.ErrorMessage, "Failed", MessageBoxButtons.RetryCancel);
                if (input == DialogResult.Retry)
                {
                    stripBtn_LogIn_Click(sender, e);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// When LogOut Button was clicked,
 /// clearing the MainWin Form, and deleting the Login Result
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void stripBtn_LogOut_Click(object sender, EventArgs e)
 {
     m_LoginResult  = new LoginResult();
     m_LoggedInUser = new FacebookWrapper.ObjectModel.User();
     LoggedOut();
 }