Exemplo n.º 1
0
        /// <summary>
        /// Find a specific friend request that the user has sent
        /// </summary>
        /// <param name="receiverId"></param>
        /// <returns></returns>
        public FriendRequest FindSentRequest(int receiverId)
        {
            FriendRequest sentRequest = null;

            if (SentRequests == null || SentRequests.Count == 0)
            {
                sentRequest = null;
            }
            else
            {
                foreach (FriendRequest fq in SentRequests)
                {
                    if (receiverId == fq.ReceiverID)
                    {
                        sentRequest = fq;
                        break;
                    }
                }
            }
            return(sentRequest);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Find a specific friend request that the user has received
        /// </summary>
        /// <param name="senderId">Serves as reqest's sender id</param>
        /// <returns></returns>
        public FriendRequest FindReceivedRequest(int senderId)
        {
            FriendRequest receivedRequest = null;

            if (ReceivedRequests == null || ReceivedRequests.Count == 0)
            {
                receivedRequest = null;
            }
            else
            {
                foreach (FriendRequest fq in ReceivedRequests)
                {
                    if (senderId == fq.SenderID)
                    {
                        receivedRequest = fq;
                        break;
                    }
                }
            }

            return(receivedRequest);
        }