Список параметров для метода photos.createAlbum
예제 #1
0
        /// <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);
        }
예제 #2
0
		/// <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;
		}
예제 #3
0
 public PhotoAlbum CreateAlbum(PhotoCreateAlbumParams @params)
 {
     return _vk.Call("photos.createAlbum", @params);
 }