Exemplo n.º 1
0
        private void timerForwardingFacebook_Tick(object sender, EventArgs e)
        {
            bool isUserLoggedIn, isUserWantToRetryLogin = true;

            timerForwardingFacebook.Enabled = false;
            if (ApplicationSettings.LastAccessToken == null)
            {
                EngineManager.LoginToFacebook();
                isUserLoggedIn = isLoginSuccessed();
                while (!isUserLoggedIn && isUserWantToRetryLogin)
                {
                    isUserWantToRetryLogin = isUserWantToTryLoginAgain();
                    if (isUserWantToRetryLogin)
                    {
                        EngineManager.LoginToFacebook();
                        isUserLoggedIn = isLoginSuccessed();
                    }
                }
            }
            else
            {
                EngineManager.ConnectToFacebookWithLastAccessToken(ApplicationSettings.LastAccessToken);
            }

            Close();
        }