Ejemplo n.º 1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     m_AppSettings = AppSettings.LoadFromFile();
     checkBoxRememberMe.Checked = m_AppSettings.RememberUser;
     if (checkBoxRememberMe.Checked)
     {
         m_LogginResult = FacebookService.Connect(m_AppSettings.LastAccessToken);
         m_LoggedInUser = m_LogginResult.LoggedInUser;
         fetchUserInfo();
         buttonLogin.sweechButton();
         buttonsEnable(true);
         m_BestFriendItemsFinderFacade = new BestFriendItemsFinderFacade()
         {
             LoggedInUser = m_LoggedInUser
         };
         m_BestFriendItemsFinderFacade.m_OnBestFriendFind += setFriendDetails;
         m_BestFriendItemsFinderFacade.m_OnItemsFind      += setBestFriendItems;
     }
 }
Ejemplo n.º 2
0
        private void loginAndInit()
        {
            try
            {
                m_LogginResult = FacebookService.Login(
                    k_AppID,
                    "public_profile",
                    "user_education_history",
                    "user_birthday",
                    "user_actions.video",
                    "user_actions.news",
                    "user_actions.music",
                    "user_actions.fitness",
                    "user_actions.books",
                    "user_about_me",
                    "user_friends",
                    "publish_actions",
                    "user_events",
                    "user_games_activity",
                    "user_hometown",
                    "user_likes",
                    "user_location",
                    "user_managed_groups",
                    "user_photos",
                    "user_posts",
                    "user_relationships",
                    "user_relationship_details",
                    "user_religion_politics",
                    "user_tagged_places",
                    "user_videos",
                    "user_website",
                    "user_work_history",
                    "read_custom_friendlists",
                    "read_page_mailboxes",
                    "manage_pages",
                    "publish_pages",
                    "publish_actions",
                    "rsvp_event");

                if (!string.IsNullOrEmpty(m_LogginResult.AccessToken))
                {
                    m_LoggedInUser = m_LogginResult.LoggedInUser;
                    fetchUserInfo();
                    m_Items = "events";
                    labelBestFriendJoinedItems.Text = "Best friend joined " + m_Items;
                    buttonsEnable(true);
                    m_BestFriendItemsFinderFacade = new BestFriendItemsFinderFacade()
                    {
                        LoggedInUser = m_LoggedInUser
                    };

                    m_BestFriendItemsFinderFacade.m_OnBestFriendFind += setFriendDetails;
                    m_BestFriendItemsFinderFacade.m_OnItemsFind      += setBestFriendItems;
                }
                else
                {
                    MessageBox.Show(m_LogginResult.ErrorMessage);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }