/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p">Параметры.</param> /// <returns></returns> public static VkParameters ToVkParameters(PhotoCreateAlbumParams p) { if (p.View == null) { p.View = new List <Privacy>(); } if (p.Privacy == null) { p.Privacy = new List <Privacy>(); } if (p.Title.Length < 2) { throw new System.Exception("Параметр title обязательный, минимальная длина 2 символа"); } var parameters = new VkParameters { { "title", p.Title }, { "group_id", p.GroupId }, { "description", p.Description }, { "privacy_view", string.Join(",", p.View) }, { "privacy_comment", string.Join(",", p.Privacy) }, { "upload_by_admins_only", p.UploadByAdminsOnly }, { "comments_disabled", p.CommentsDisabled } }; return(parameters); }
/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p">Параметры.</param> /// <returns></returns> internal static VkParameters ToVkParameters(PhotoCreateAlbumParams p) { if (p.View == null) { p.View = new List<Privacy>(); } if (p.Privacy == null) { p.Privacy = new List<Privacy>(); } if (p.Title.Length < 2) { throw new System.Exception("Параметр title обязательный, минимальная длина 2 символа"); } var parameters = new VkParameters { { "title", p.Title }, { "group_id", p.GroupId }, { "description", p.Description }, { "privacy_view", string.Join(",", p.View) }, { "privacy_comment", string.Join(",", p.Privacy) }, { "upload_by_admins_only", p.UploadByAdminsOnly }, { "comments_disabled", p.CommentsDisabled } }; return parameters; }
public PhotoAlbum CreateAlbum(PhotoCreateAlbumParams @params) { return _vk.Call("photos.createAlbum", @params); }