예제 #1
0
        public FacebookDataProvider(FacebookApiInfo apiInfo)
        {
            if (apiInfo == null)
            {
                throw new ArgumentNullException("apiInfo");
            }

            _apiInfo = apiInfo;
        }
예제 #2
0
        public static FacebookApiInfo GetFacebookApiInfoForCurrentUser()
        {
            FacebookApiInfo apiInfo = new FacebookApiInfo();

            SetDefaultTokens(apiInfo);

            if (String.IsNullOrEmpty(apiInfo.AccessToken))
                return null;
            else
                return apiInfo;
        }
예제 #3
0
 private static void SetDefaultTokens(FacebookApiInfo apiInfo)
 {
     apiInfo.AccessToken = KeyStorage.Get(SocialMediaConstants.ConfigKeyFacebookDefaultAccessToken);
 }
예제 #4
0
 public void GetUrlOfUserImageTest()
 {
     var ai = new FacebookApiInfo { AccessToken = "186245251433148|5fecd56abddd9eb63b506530.1-100002072952328|akD66RBlkeedQmhy50T9V_XCTYs" };
     var provider = new FacebookDataProvider(ai);
     var url = provider.GetUrlOfUserImage("kamorin.roman", FacebookDataProvider.ImageSize.Original);
 }
        public FacebookDataProvider(FacebookApiInfo apiInfo)
        {
            if (apiInfo == null) throw new ArgumentNullException("apiInfo");

            _apiInfo = apiInfo;
        }
예제 #6
0
 private List<Message> GetUserWallFacebook()
 {
     List<Message> messageList = new List<Message>();
     try
     {
         FacebookApiInfo apiInfo = new FacebookApiInfo { AccessToken = FacebookInformation.AccessToken };
         FacebookDataProvider facebookProvider = new FacebookDataProvider(apiInfo);
         messageList.AddRange(facebookProvider.LoadUserWall(FacebookInformation.UserID, MessageCount));
     }
     catch (Exception ex)
     {
         ThrownExceptions.Add(ex);
     }
     return messageList;
 }