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

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

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

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

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

            var response = SendRequest<fbml_refreshImgSrc_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
Пример #3
0
 /// <summary>
 /// Fetches and re-caches the image 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/Clarity.jpg";
 ///     api.Fbml.RefreshImgSrcAsync(url, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;fql_result&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="url">The absolute URL from which to refresh the image.</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 1 if Facebook found a cached version of your image and successfully refreshed the image. It returns a blank response if Facebook was unable to find any previously cached version to refresh, or the image was unable to be re-fetched from your site and cached successfully. In such instances, whatever images were cached before remain as they were cached.</returns>
 public void RefreshImgSrcAsync(string url, RefreshImgSrcCallback callback, Object state)
 {
     RefreshImgSrc(url, true, callback, state);
 }
 /// <summary>
 /// Fetches and re-caches the image 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/Clarity.jpg";
 ///     api.Fbml.RefreshImgSrcAsync(url, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(IList&lt;fql_result&gt; result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="url">The absolute URL from which to refresh the image.</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 1 if Facebook found a cached version of your image and successfully refreshed the image. It returns a blank response if Facebook was unable to find any previously cached version to refresh, or the image was unable to be re-fetched from your site and cached successfully. In such instances, whatever images were cached before remain as they were cached.</returns>
 public void RefreshImgSrcAsync(string url, RefreshImgSrcCallback callback, Object state)
 {
     RefreshImgSrc(url, true, callback, state);
 }