Exemplo n.º 1
0
		public bool Edit(long postId, long? ownerId = null, bool friendsOnly = false,
			string message = null, IEnumerable<MediaAttachment> mediaAttachments = null, string url = null,
			IEnumerable<Services> services = null, bool signed = false, DateTime? publishDate = null,
			double? lat = null, double? @long = null, long? placeId = null)
		{
			if (string.IsNullOrEmpty(message) && (mediaAttachments == null || !mediaAttachments.Any()) && string.IsNullOrEmpty(url))
				throw new ArgumentException("Message and attachments cannot be null or empty at the same time.");
			VkErrors.ThrowIfNumberIsNegative(() => placeId);
			VkErrors.ThrowIfNumberIsNegative(() => postId);
			if (lat.HasValue && (Math.Abs(lat.Value) > 90))
				throw new ArgumentOutOfRangeException("lat", lat, "lat must be at range from -90 to 90");
			if (@long.HasValue && (Math.Abs(@long.Value) > 180))
				throw new ArgumentOutOfRangeException("long", @long, "long must be at range from -90 to 90");

			var parameters = new WallEditParams
			{
				PostId = postId,
				OwnerId = ownerId,
				FriendsOnly = friendsOnly,
				Message = message,
				Attachments = mediaAttachments,
				Services = services,
				Signed = signed,
				PublishDate = publishDate,
				Lat = lat,
				Long = @long,
				PlaceId = placeId
			};
			return Edit(parameters);
		}
Exemplo n.º 2
0
		public bool Edit(WallEditParams @params)
		{
			return _vk.Call("wall.edit", @params);
		}
Exemplo n.º 3
0
 /// <summary>
 /// Edits a post on a user wall or community wall.
 /// </summary>
 /// <param name="methodParams">A <see cref="WallEditParams"/> object with the params.</param>
 /// <returns>If successfully executed, returns True.</returns>
 public async Task<Response<bool>> Edit(WallEditParams methodParams) => await Request<bool>("edit", methodParams);