public void updateFields()
        {
            FriendListItem friendListItem = (Application.Current as App).app_friendListItem;

            if (friendListItem == null)
            {
                MessageBox.Show("Error!");
                NavigationService.GoBack();
            }
            tb_Name.Text  = friendListItem.FriendName;
            tb_Phone.Text = friendListItem.FriendPhone;
            tb_Email.Text = friendListItem.FriendEmail;
            tb_Pro.Text   = friendListItem.FriendPro;
            tb_Fb.Text    = "facebook.com/" + friendListItem.FriendFbId;
        }
Example #2
0
        public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
        {
            FriendListItem newfriend = new FriendListItem();

            newfriend.FriendPerms     = perms;
            newfriend.Friend          = friend;
            newfriend.FriendListOwner = friendlistowner;

            if (!m_friendsListByUuid.ContainsKey(friendlistowner))
            {
                List <FriendListItem> friendslist = new List <FriendListItem>();
                m_friendsListByUuid[friendlistowner] = friendslist;
            }
            m_friendsListByUuid[friendlistowner].Add(newfriend);
        }
        /// <summary>
        /// Converts XMLRPC Friend List to FriendListItem Object
        /// </summary>
        /// <param name="data">XMLRPC response data Hashtable</param>
        /// <returns></returns>
        public Dictionary <UUID, FriendListItem> ConvertXMLRPCDataToFriendListItemList(Hashtable data)
        {
            Dictionary <UUID, FriendListItem> buddies = new Dictionary <UUID, FriendListItem>();
            int buddycount = Convert.ToInt32((string)data["avcount"]);

            for (int i = 0; i < buddycount; i++)
            {
                FriendListItem buddylistitem = new FriendListItem();

                buddylistitem.FriendListOwner      = new UUID((string)data["ownerID" + i.ToString()]);
                buddylistitem.Friend               = new UUID((string)data["friendID" + i.ToString()]);
                buddylistitem.FriendListOwnerPerms = (uint)Convert.ToInt32((string)data["ownerPerms" + i.ToString()]);
                buddylistitem.FriendPerms          = (uint)Convert.ToInt32((string)data["friendPerms" + i.ToString()]);

                buddies.Add(buddylistitem.Friend, buddylistitem);
            }

            return(buddies);
        }
        public override List <FriendListItem> GetUserFriendList(UUID ownerId)
        {
            List <FriendListItem>             friendList = new List <FriendListItem>();
            Dictionary <UUID, FriendListItem> friendListItemDictionary = new Dictionary <UUID, FriendListItem>();

            using (ISession session = manager.GetSession())
            {
                ICriteria criteria = session.CreateCriteria(typeof(UserFriend));
                criteria.Add(Expression.Or(
                                 Expression.Eq("OwnerID", ownerId),
                                 Expression.Eq("FriendID", ownerId)
                                 ));

                foreach (UserFriend userFriend in criteria.List())
                {
                    if (userFriend.OwnerID == ownerId)
                    {
                        FriendListItem friendListItem = new FriendListItem();
                        friendListItem.FriendListOwner = userFriend.OwnerID;
                        friendListItem.Friend          = userFriend.FriendID;
                        friendListItem.FriendPerms     = userFriend.FriendPermissions;
                        friendListItemDictionary.Add(userFriend.FriendID, friendListItem);
                        friendList.Add(friendListItem);
                    }
                }

                // Reading permissions to other direction
                foreach (UserFriend userFriend in criteria.List())
                {
                    if (userFriend.FriendID == ownerId)
                    {
                        //Ignore if there is no reverse relation existing.
                        //if (friendListItemDictionary.ContainsKey(userFriend.OwnerID))
                        {
                            FriendListItem friendListItem = friendListItemDictionary[userFriend.OwnerID];
                            friendListItem.FriendListOwnerPerms = userFriend.FriendPermissions;
                        }
                    }
                }
            }

            return(friendList);
        }
Example #5
0
        protected List <FriendListItem> ConvertXMLRPCDataToFriendListItemList(Hashtable data)
        {
            List <FriendListItem> buddylist = new List <FriendListItem>();
            int buddycount = Convert.ToInt32((string)data["avcount"]);


            for (int i = 0; i < buddycount; i++)
            {
                FriendListItem buddylistitem = new FriendListItem();

                buddylistitem.FriendListOwner      = new UUID((string)data["ownerID" + i.ToString()]);
                buddylistitem.Friend               = new UUID((string)data["friendID" + i.ToString()]);
                buddylistitem.FriendListOwnerPerms = (uint)Convert.ToInt32((string)data["ownerPerms" + i.ToString()]);
                buddylistitem.FriendPerms          = (uint)Convert.ToInt32((string)data["friendPerms" + i.ToString()]);

                buddylist.Add(buddylistitem);
            }

            return(buddylist);
        }
Example #6
0
        // Hämtar användarens vänlista.
        public ActionResult FriendList()
        {
            var ctx            = new ProfileDbContext();
            var currentID      = User.Identity.GetUserId();
            var friendList     = ctx.Friends.Where(f => f.Person1 == currentID || f.Person2 == currentID);
            var listOfProfiles = ctx.Profiles.ToList();
            List <FriendListItem> listToSend = new List <FriendListItem>();

            // Hämtar förnamn, efternamn och ID't på alla kontakter som användaren har.
            foreach (var f in friendList)
            {
                var profile = listOfProfiles.FirstOrDefault(p => p.UserID != currentID && (p.UserID == f.Person1 || p.UserID == f.Person2));
                var friend  = new FriendListItem
                {
                    UserId    = profile.UserID,
                    Firstname = profile.FirstName,
                    Lastname  = profile.LastName
                };
                listToSend.Add(friend);
            }
            // Skickar sedan vidare kontakterna i en lista.
            return(View(listToSend));
        }
Example #7
0
 private void renderOwner(FriendListItem friendListItem, DataEntityHandle handle, string displayName, bool isOnline)
 {
     if (!friendListItem.IsRendered || (friendListItem.IsOnlineSet && isOnline != friendListItem.IsOnline))
     {
         friendListItem.IsRendered = true;
         friendListItem.SetPreloaderActive(isActive: true);
         friendListItem.SetAvatarIconActive(isActive: false);
         if (friendAvatarRenderer.IsRenderInProgress(displayName))
         {
             friendAvatarRenderer.CancelRender(displayName);
         }
         if (isOnline)
         {
             AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(IdlePenguinState, 0.5f);
             friendAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListIdle");
         }
         else
         {
             AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame(SleepingPenguinState, 0.75f);
             friendAvatarRenderer.RequestImage(handle, avatarAnimationFrame, "FriendsListSleeping");
         }
     }
 }
Example #8
0
    public void RefreshListView()
    {
        foreach (Transform child in listContent)
        {
            GameObject.Destroy(child.gameObject);
        }

        for (int i = 0; i < friendReceiveInfo.Count; i++)
        {
            UserFriend        friend   = userFriends.Find(x => x.nickname_friend == friendReceiveInfo[i].nickname);
            FriendReceiveItem listItem = Instantiate(friendReceiveItem);
            listItem.Initialize(friendReceiveInfo[i], friend, this);
            listItem.transform.SetParent(listContent, false);
        }

        for (int i = 0; i < friendListInfo.Count; i++)
        {
            UserFriend     friend   = userFriends.Find(x => x.nickname_friend == friendListInfo[i].nickname);
            FriendListItem listItem = Instantiate(friendListItem);
            listItem.Initialize(friendListInfo[i], friend, this);
            listItem.transform.SetParent(listContent, false);
        }
    }
 public int ItemsSortCompare(FriendListItem item1, FriendListItem item2)
 {
     object[] objArray1 = new object[] { item1, item2 };
     return(base.method_11 <int>("ItemsSortCompare", objArray1));
 }
 public void PostProcessBinding(FriendListItem item, string display, object value)
 {
     string id = value.ToString();
     item.SetFriendData(FriendListItem.FriendType.Nothing, id, null);
     item.SetSelectable(WasSelected(id));
 }
 public void PostProcessBinding(FriendListItem item, string display, object value)
 {
     string id = value.ToString();
     var friendType = HamburglarUiFriends.GetFriendshipType(this.View, id);
     item.SetFriendData(friendType, id, Rebind);
 }