Exemple #1
0
        public Boolean DeleteFriendFromUsersFriendList(Friend iFriend)
        {
            Boolean pBlnCreatedTable = cCTeFriendsLists.CreateIfNotExists();

            if (pBlnCreatedTable)
            {
                return(false);
            }
            else
            {
                TableOperation pTOnDelete = TableOperation.Delete(iFriend);
                TableResult    pTRtResult;
                try
                {
                    pTRtResult = FriendsListTable.Execute(pTOnDelete);
                    switch (pTRtResult.HttpStatusCode)
                    {
                    case 200:
                    case 204:
                    {
                        return(true);
                    }

                    default:
                    {
                        return(false);
                    }
                    }
                }
                catch
                {
                    return(false);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Insert a friend into a users friends list
        /// </summary>
        /// <param name="iFriend">The friend to insert to the friends list, created by FriendsList.AddFriend</param>
        /// <returns>True if the friend was inserted successfully</returns>
        public Boolean InsertFriendIntoFriendsList(Friend iFriend)
        {
            Boolean        pBlnCreatedTable = cCTeFriendsLists.CreateIfNotExists();
            TableOperation pTOnInsert       = TableOperation.Insert(iFriend);
            TableResult    pTRtResult;

            try
            {
                pTRtResult = FriendsListTable.Execute(pTOnInsert);
                switch (pTRtResult.HttpStatusCode)
                {
                case 200:
                case 204:
                {
                    return(true);
                }

                default:
                {
                    return(false);
                }
                }
            }
            catch
            {
                return(false);
            }
        }