/// <summary> /// This method returns any filters a user has specified for his or her home page stream. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey)); /// api.Stream.GetFiltersAsync(Constants.UserId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<stream_filter> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uid">The user ID for the user whose stream filters you are returning. Note: This parameter applies only to Web applications. Facebook ignores this parameter if it is passed by a desktop application.</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 a List of data containing the fields from the stream_filter_(FQL) table.</returns> public void GetFiltersAsync(long uid, GetFiltersCallback callback, Object state) { GetFilters(uid, true, callback, state); }
private IList<stream_filter> GetFilters(long uid, bool isAsync, GetFiltersCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.stream.getFilters" } }; Utilities.AddOptionalParameter(parameterList, "uid", uid); if (isAsync) { SendRequestAsync<stream_getFilters_response, IList<stream_filter>>(parameterList, uid <=0, new FacebookCallCompleted<IList<stream_filter>>(callback), state, "stream_filter"); return null; } var response = SendRequest<stream_getFilters_response>(parameterList, uid <= 0); return response == null ? null : response.stream_filter; }
/// <summary> /// This method returns any filters a user has specified for his or her home page stream. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.SessionSecret, Constants.SessionKey)); /// api.Stream.GetFiltersAsync(AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<stream_filter> 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 a List of data containing the fields from the stream_filter_(FQL) table.</returns> public void GetFiltersAsync(GetFiltersCallback callback, Object state) { GetFiltersAsync(0, callback, state); }