private IList <info_item> GetInfoOptions(string field, bool isAsync, GetInfoOptionsCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.profile.getInfoOptions" } }; Utilities.AddRequiredParameter(parameterList, "field", field); if (isAsync) { SendRequestAsync <profile_getInfoOptions_response, IList <info_item> >(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <IList <info_item> >(callback), state, "info_item"); return(null); } var response = SendRequest <profile_getInfoOptions_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response == null ? null : response.info_item); }
/// <summary> /// Returns the options associated with the specified field for an application info section. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// api.Session.UserId = Constants.UserId; /// api.Profile.GetInfoOptionsAsync("Test Field", AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<info_item> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="field">The title of the field.</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 info_item objects (typeahead options) for the specified field.</returns> public void GetInfoOptionsAsync(string field, GetInfoOptionsCallback callback, Object state) { GetInfoOptions(field, true, callback, state); }