/// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardGallery" /> class.
        /// </summary>
        /// <param name="username">The Twitter username of the creator of the content on the page e.g. @RehanSaeedUK. This is an optional property.</param>
        /// <param name="image0">The image0.</param>
        /// <param name="image1">The image1.</param>
        /// <param name="image2">The image2.</param>
        /// <param name="image3">The image3.</param>
        /// <exception cref="System.ArgumentNullException">username or image0 or image1 or image2 or image3 is <c>null</c>.</exception>
        public TwitterCardGallery(string username, TwitterImage image0, TwitterImage image1, TwitterImage image2, TwitterImage image3)
            : base(username)
        {
            if (image0 == null)
            {
                throw new ArgumentNullException(nameof(image0));
            }
            if (image1 == null)
            {
                throw new ArgumentNullException(nameof(image1));
            }
            if (image2 == null)
            {
                throw new ArgumentNullException(nameof(image2));
            }
            if (image3 == null)
            {
                throw new ArgumentNullException(nameof(image3));
            }

            this.Image0 = image0;
            this.Image1 = image1;
            this.Image2 = image2;
            this.Image3 = image3;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardPlayer" /> class.
        /// </summary>
        /// <param name="username">The Twitter username associated with the page e.g. @RehanSaeedUK. This is a required property.</param>
        /// <param name="image">The image to be displayed in place of the player on platforms that don’t support iframes or inline players. 
        /// You should make this image the same dimensions as your player. Images with fewer than 68,600 pixels 
        /// (a 262x262 square image, or a 350x196 16:9 image) will cause the player card not to render. 
        /// Image must be less than 1MB in size.</param>
        /// <param name="player">The video player.</param>
        /// <exception cref="System.ArgumentNullException">username is <c>null</c>.</exception>
        public TwitterCardPlayer(string username, TwitterImage image, TwitterPlayer player) : base(username)
        {
            if (image == null) { throw new ArgumentNullException(nameof(image)); }
            if (player == null) { throw new ArgumentNullException(nameof(player)); }

            this.Image = image;
            this.Player = player;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardPhoto"/> class.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="image">The image to use.</param>
        /// <exception cref="System.ArgumentNullException">username or image is <c>null</c>.</exception>
        public TwitterCardPhoto(string username, TwitterImage image) : base(username)
        {
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            this.Image = image;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardGallery" /> class.
        /// </summary>
        /// <param name="username">The Twitter username of the creator of the content on the page e.g. @RehanSaeedUK. This is an optional property.</param>
        /// <param name="image0">The image0.</param>
        /// <param name="image1">The image1.</param>
        /// <param name="image2">The image2.</param>
        /// <param name="image3">The image3.</param>
        /// <exception cref="System.ArgumentNullException">username or image0 or image1 or image2 or image3 is <c>null</c>.</exception>
        public TwitterCardGallery(string username, TwitterImage image0, TwitterImage image1, TwitterImage image2, TwitterImage image3)
            : base(username)
        {
            if (image0 == null) { throw new ArgumentNullException(nameof(image0)); }
            if (image1 == null) { throw new ArgumentNullException(nameof(image1)); }
            if (image2 == null) { throw new ArgumentNullException(nameof(image2)); }
            if (image3 == null) { throw new ArgumentNullException(nameof(image3)); }

            this.Image0 = image0;
            this.Image1 = image1;
            this.Image2 = image2;
            this.Image3 = image3;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardPlayer" /> class.
        /// </summary>
        /// <param name="username">The Twitter username associated with the page e.g. @RehanSaeedUK. This is a required property.</param>
        /// <param name="image">The image to be displayed in place of the player on platforms that don’t support iframes or inline players.
        /// You should make this image the same dimensions as your player. Images with fewer than 68,600 pixels
        /// (a 262x262 square image, or a 350x196 16:9 image) will cause the player card not to render.
        /// Image must be less than 1MB in size.</param>
        /// <param name="player">The video player.</param>
        /// <exception cref="System.ArgumentNullException">username is <c>null</c>.</exception>
        public TwitterCardPlayer(string username, TwitterImage image, TwitterPlayer player) : base(username)
        {
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }

            this.Image  = image;
            this.Player = player;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TwitterCardPhoto"/> class.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="image">The image to use.</param>
        /// <exception cref="System.ArgumentNullException">username or image is <c>null</c>.</exception>
        public TwitterCardPhoto(string username, TwitterImage image) : base(username)
        {
            if (image == null) { throw new ArgumentNullException(nameof(image)); }

            this.Image = image;
        }