Beispiel #1
0
        private int GetUnconnectedFriends(bool isAsync, GetUnconnectedFriendsCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.connect.getUnconnectedFriendsCount" }
            };

            if (isAsync)
            {
                SendRequestAsync(parameterList, new FacebookCallCompleted <int>(callback), state);
                return(0);
            }

            var response = SendRequest <connect_getUnconnectedFriendsCount_response>(parameterList);

            return(response == null ? 0 : response.TypedValue);
        }
Beispiel #2
0
 /// <summary>
 /// Returns the number of friends of the current user who have accounts on your site, but have not yet connected their accounts. (for [{Facebook Connect]]).
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     ConnectSession connectSession = new ConnectSession(Constants.ApplicationKey, Constants.ApplicationSecret);
 ///
 ///     ///
 ///     /// NOTE: This is shortened for brevity; would require a postback after completing Facebook Connect authentication.
 ///     ///
 ///
 ///     if (connectSession.IsConnected())
 ///     {
 ///         Api api = new Api(connectSession);
 ///         api.Connect.GetUnconnectedFriendsAsync(AsyncDemoCompleted, null);
 ///     }
 /// }
 ///
 /// private static void AsyncDemoCompleted(int result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns an int that indicates the number of users who have not yet connected their accounts.</returns>
 public void GetUnconnectedFriendsAsync(GetUnconnectedFriendsCallback callback, Object state)
 {
     GetUnconnectedFriends(true, callback, state);
 }