Exemplo n.º 1
0
        private bool IsFan(long page_id, long uid, bool isAsync, IsFanCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.pages.isFan" }
            };

            Utilities.AddOptionalParameter(parameterList, "page_id", page_id);
            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync <pages_isFan_response, bool>(parameterList, new FacebookCallCompleted <bool>(callback), state);
                return(true);
            }

            var response = SendRequest <pages_isFan_response>(parameterList);

            return(response == null ? true : response.TypedValue);
        }
        private bool IsFan(long page_id, long uid, bool isAsync, IsFanCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.pages.isFan" } };
            Utilities.AddOptionalParameter(parameterList, "page_id", page_id);
            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync<pages_isFan_response, bool>(parameterList, new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<pages_isFan_response>(parameterList);
            return response == null ? true : response.TypedValue;
        }
 /// <summary>
 /// Checks whether a user is a fan of a given Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Pages.IsFanAsync(Constants.PageId, Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="page_id">The ID of the page.</param>
 /// <param name="uid">The ID of the user. Defaults to the logged-in user if not set.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>Returns true or false.</returns>
 public void IsFanAsync(long page_id, long uid, IsFanCallback callback, Object state)
 {
     IsFan(page_id, uid, true, callback, state);
 }
 /// <summary>
 /// Checks whether a user is a fan of a given Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Pages.IsFanAsync(Constants.PageId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="page_id">The ID of the page.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>Returns true or false.</returns>
 public void IsFanAsync(long page_id, IsFanCallback callback, Object state)
 {
     IsFanAsync(page_id, Session.UserId, callback, state);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Checks whether a user is a fan of a given Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Pages.IsFanAsync(Constants.PageId, Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="page_id">The ID of the page.</param>
 /// <param name="uid">The ID of the user. Defaults to the logged-in user if not set.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>Returns true or false.</returns>
 public void IsFanAsync(long page_id, long uid, IsFanCallback callback, Object state)
 {
     IsFan(page_id, uid, true, callback, state);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Checks whether a user is a fan of a given Page.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Pages.IsFanAsync(Constants.PageId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="page_id">The ID of the page.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>Returns true or false.</returns>
 public void IsFanAsync(long page_id, IsFanCallback callback, Object state)
 {
     IsFanAsync(page_id, Session.UserId, callback, state);
 }