BoxKite.Twitter.UsersExtensions.ChangeProfileBanner C# (CSharp) Метод

ChangeProfileBanner() публичный статический Метод

Removes the uploaded profile banner for the authenticating user. Returns HTTP 20x upon success.
ref: https://dev.twitter.com/docs/api/1.1/post/account/update_profile_banner
public static ChangeProfileBanner ( this session, string fileName, Stream imageContentStream, int bannerWidth, int bannerHeight, int bannerLeftOffset, int bannerTopOffset ) : Task
session this
fileName string file name for upload
imageContentStream System.IO.Stream Stream of image content
bannerWidth int The width of the preferred section of the image being uploaded in pixels. Use with height, offset_left, and offset_top to select the desired region of the image to use.
bannerHeight int The height of the preferred section of the image being uploaded in pixels. Use with width, offset_left, and offset_top to select the desired region of the image to use.
bannerLeftOffset int The number of pixels by which to offset the uploaded image from the left. Use with height, width, and offset_top to select the desired region of the image to use.
bannerTopOffset int The number of pixels by which to offset the uploaded image from the top. Use with height, width, and offset_left to select the desired region of the image to use.
Результат Task
        public static async Task<TwitterSuccess> ChangeProfileBanner(this IUserSession session, string fileName, Stream imageContentStream, int bannerWidth = 0, int bannerHeight = 0, int bannerLeftOffset = 0, int bannerTopOffset = 0)
        {
            var parameters = new TwitterParametersCollection();

            if (bannerWidth != 0)
            {
                parameters.Add("width", bannerWidth.ToString());
            }

            if (bannerHeight != 0)
            {
                parameters.Add("height", bannerWidth.ToString());
            }

            if (bannerLeftOffset != 0)
            {
                parameters.Add("offset_left", bannerWidth.ToString());
            }

            if (bannerTopOffset != 0)
            {
                parameters.Add("offset_top", bannerWidth.ToString());
            }

            return await session.PostFileAsync(TwitterApi.Resolve("/1.1/account/update_profile_banner.json"), parameters, fileName, "banner", srImage: imageContentStream)
                .ContinueWith(c => c.MapToTwitterSuccess());

       }

Same methods

UsersExtensions::ChangeProfileBanner ( this session, string fileName, byte imageContent, int bannerWidth, int bannerHeight, int bannerLeftOffset, int bannerTopOffset ) : Task