private album CreateAlbum(string name, string location, string description, long uid ,bool isAsync, CreateAlbumCallback callback, Object state) { var parameterList = new Dictionary<string, string> {{"method", "facebook.photos.createAlbum"}}; Utilities.AddRequiredParameter(parameterList, "name", name); Utilities.AddOptionalParameter(parameterList, "location", location); Utilities.AddOptionalParameter(parameterList, "description", description); Utilities.AddOptionalParameter(parameterList, "uid", uid); if (isAsync) { SendRequestAsync(parameterList, uid <= 0, new FacebookCallCompleted<album>(callback), state); return null; } return SendRequest<photos_createAlbum_response>(parameterList, uid <= 0); }
/// <summary> /// Creates and returns a new album owned by the current session user. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// api.Photos.CreateAlbumAsync("test album name", "Chicago, IL", "Code sample album", Constants.UserId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(album result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="name">The album name.</param> /// <param name="location">Optional - The album location.</param> /// <param name="description">Optional - The album description.</param> /// <param name="uid"></param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>A new album owned by the current session user</returns> /// <remarks>The returned cover_pid is always 0.</remarks> public void CreateAlbumAsync(string name, string location, string description, long uid, CreateAlbumCallback callback, Object state) { CreateAlbum(name, location, description, uid, true, callback, state); }