Пример #1
0
        private bool RefreshRefUrl(string url, bool isAsync, RefreshRefUrlCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string>
            {
                { "method", "facebook.fbml.refreshRefUrl" },
                { "url", string.Format(CultureInfo.CurrentUICulture, url) }
            };

            if (isAsync)
            {
                SendRequestAsync <fbml_refreshRefUrl_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state);
                return(true);
            }

            var response = SendRequest <fbml_refreshRefUrl_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));

            return(response == null ? true : response.TypedValue);
        }
        private bool RefreshRefUrl(string url, bool isAsync, RefreshRefUrlCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string>
                                    {
                                        {"method", "facebook.fbml.refreshRefUrl"},
                                        {"url", string.Format(CultureInfo.CurrentUICulture, url)}
                                    };

            if (isAsync)
            {
                SendRequestAsync<fbml_refreshRefUrl_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<fbml_refreshRefUrl_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
Пример #3
0
 /// <summary>
 /// Fetches and re-caches the content stored at the given URL.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey));
 ///     var url = "http://facebook.claritycon.com/Tests/FBML.html";
 ///     api.Fbml.RefreshRefUrlAsync(url, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="url">The absolute URL from which to fetch content. This URL should be used in a fb:ref FBML tag.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns true if the content was fetched and re-cached from the specified URL.</returns>
 public void RefreshRefUrlAsync(string url, RefreshRefUrlCallback callback, Object state)
 {
     RefreshRefUrl(url, true, callback, state);
 }
 /// <summary>
 /// Fetches and re-caches the content stored at the given URL.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey));
 ///     var url = "http://facebook.claritycon.com/Tests/FBML.html";
 ///     api.Fbml.RefreshRefUrlAsync(url, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="url">The absolute URL from which to fetch content. This URL should be used in a fb:ref FBML tag.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>This method returns true if the content was fetched and re-cached from the specified URL.</returns>
 public void RefreshRefUrlAsync(string url, RefreshRefUrlCallback callback, Object state)
 {
     RefreshRefUrl(url, true, callback, state);
 }