示例#1
0
 public void areFriendsTest1()
 {
     var target = _api.friends;
     var user1 = new user { uid = Constants.FBSamples_friend1 };
     var user2 = new user {uid = Constants.FBSamples_friend2};
     var actual = target.areFriends(user1, user2);
     Assert.IsTrue(actual[0].are_friends.Value);
 }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         FriendList1.Friends = API.friends.getUserObjects();
         IList <album>        albums   = API.photos.getAlbums();
         facebook.Schema.user userinfo = API.users.getInfo(API.uid);
         Label1.Text     = "Hi, " + userinfo.first_name;
         Image1.ImageUrl = userinfo.pic;
         foreach (user u in FriendList1.Friends)
         {
             DateTime bdate = u.birthday_date;
             DropDownList1.Items.Add(u.first_name);
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        CargarGrilla();

        if (!IsPostBack)
        {
            IList <album>        albums   = API.photos.getAlbums();
            facebook.Schema.user userinfo = API.users.getInfo(API.uid);
            //Label1.Text = "Hi, " + userinfo.first_name;
            //Image1.ImageUrl = userinfo.pic;
        }

        if (DBKeeper.getInstance().EstaAsociado(API.uid))
        {
            lbAsociarCuenta.Visible = false;
        }
        else
        {
            lbAsociarCuenta.Visible = true;
        }
    }
示例#4
0
文件: Contact.cs 项目: attiks/OutSync
        /// <summary>
        /// Populates internal fields such as name, status, networks etc. 
        /// with information about the given Facebook user.
        /// </summary>
        /// <param name="user"></param>
        public void SetFaceBookInfo(user user)
        {
            //_facebookId = user.uid;
            _name = user.name;
            _status = user.status.message;
            _networks = String.Empty;

            if (user.birthday.Length > 0)
            {
                try
                {
                    DateTime dob = Convert.ToDateTime(user.birthday);
                    _dob = dob;
                }
                catch { }
            }

            foreach (facebook.Schema.affiliation aff in user.affiliations.affiliation)
            {
                _networks += Environment.NewLine + aff.name;
            }

            _networks = _networks.Trim();

            try
            {
                _pictureUrl = new Uri(user.pic_big);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
示例#5
0
 /// <summary>
 /// Returns whether or not the pair of specified users is friends with each other.
 /// </summary>
 /// <param name="user1">First user.</param>
 /// <param name="user2">Second user.</param>
 /// <returns>Returns a list of friend_info elements corresponding to the lists passed.</returns>
 public IList<friend_info> areFriends(user user1, user user2)
 {
     var uids1 = new List<long>();
     var uids2 = new List<long>();
     uids1.Add(user1.uid.Value);
     uids2.Add(user2.uid.Value);
     return areFriends(uids1, uids2);
 }