Exemplo n.º 1
0
        private bool DeleteCustomTags(List <string> names, bool isAsync, DeleteCustomTagsCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.fbml.deleteCustomTags" }
            };

            Utilities.AddJSONArray(parameterList, "names", names);
            //{"names", JSONHelper.ConvertToJSONArray(names)}

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

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

            return(response == null ? true : response.TypedValue);
        }
        private bool DeleteCustomTags(List<string> names, bool isAsync, DeleteCustomTagsCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> {{"method", "facebook.fbml.deleteCustomTags"}};
            Utilities.AddJSONArray(parameterList, "names", names);
            //{"names", JSONHelper.ConvertToJSONArray(names)}

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

            var response = SendRequest<fbml_deleteCustomTags_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deletes one or more custom tags you previously registered for the calling application with fbml.registerCustomTags.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     List&lt;string&gt; tags = new List&lt;string&gt; { "video", "gallery" };
 ///     api.Fbml.DeleteCustomTagsAsync(tags, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="names">A List of strings containing the names of the tags you want to delete. If this attribute is missing, all the application's custom tags will be deleted.</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 custom tag deletes were successful.</returns>
 public void DeleteCustomTagsAsync(List <string> names, DeleteCustomTagsCallback callback, Object state)
 {
     DeleteCustomTags(names, true, callback, state);
 }
 /// <summary>
 /// Deletes one or more custom tags you previously registered for the calling application with fbml.registerCustomTags.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     List&lt;string&gt; tags = new List&lt;string&gt; { "video", "gallery" };
 ///     api.Fbml.DeleteCustomTagsAsync(tags, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="names">A List of strings containing the names of the tags you want to delete. If this attribute is missing, all the application's custom tags will be deleted.</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 custom tag deletes were successful.</returns>
 public void DeleteCustomTagsAsync(List<string> names, DeleteCustomTagsCallback callback, Object state)
 {
     DeleteCustomTags(names, true, callback, state);
 }