Esempio n. 1
0
    private void BindFriends()
    {
        members = Friendship
                  .GetList(profileOwner.Id)
                  .Select(x => new Member(profileOwner.Id == x.UserIdOne ? x.UserIdTwo : x.UserIdOne))
                  .ToList();

        for (int i = 0; i < members.Count; i++)
        {
            UserControl friendInfoControl = (UserControl)Page.LoadControl("~/Controls/Network/FriendInfo.ascx");

            PropertyInfo member = friendInfoControl.GetType().GetProperty("Friend");
            member.SetValue(friendInfoControl, members[i], null);

            friendInfoControl.DataBind();
            FriendInfoPlaceHolder.Controls.Add(friendInfoControl);
        }
    }
Esempio n. 2
0
    private void BindFriends()
    {
        members = Friendship
                  .GetList(Member.CurrentId)
                  .Select(x => new Member(Member.CurrentId == x.UserIdOne ? x.UserIdTwo : x.UserIdOne))
                  .ToList();

        for (int i = 0; i < members.Count; i++)
        {
            UserControl friendInfoControl = (UserControl)Page.LoadControl("~/Controls/Network/FriendInfo.ascx");

            PropertyInfo member = friendInfoControl.GetType().GetProperty("Friend");
            member.SetValue(friendInfoControl, members[i], null);

            if (Request.QueryString["conv"] != null)
            {
                friendInfoControl.GetType().GetProperty("RedirectToMessenger").SetValue(friendInfoControl, true, null);
            }

            friendInfoControl.DataBind();
            FriendInfoPlaceHolder.Controls.Add(friendInfoControl);
        }
    }