/// <summary> /// Initializes a new instance of the <see cref="PhotoTwitterCard"/> 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 PhotoTwitterCard(string username, TwitterImage image) : base(username) { if (image == null) { throw new ArgumentNullException("image"); } this._image = image; }
/// <summary> /// Initializes a new instance of the <see cref="GalleryTwitterCard" /> 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 GalleryTwitterCard(string username, TwitterImage image0, TwitterImage image1, TwitterImage image2, TwitterImage image3) : base(username) { if (image0 == null) { throw new ArgumentNullException("image0"); } if (image1 == null) { throw new ArgumentNullException("image1"); } if (image2 == null) { throw new ArgumentNullException("image2"); } if (image3 == null) { throw new ArgumentNullException("image3"); } this._image0 = image0; this._image1 = image1; this._image2 = image2; this._image3 = image3; }
public void Send(Usuario usuario) { var twitter = new TwitterImage(consumerKey, consumerKeySecret, accessToken, accessTokenSecret); Console.WriteLine(twitter.PublishToTwitter($"{usuario.Message}", $@"{usuario.Foto}")); //var twitterDirectMessage = new TwitterMessage(consumerKey, consumerKeySecret, accessToken, accessTokenSecret); //Console.WriteLine(twitterDirectMessage.SendMessage("Hola!", "380889967")); }
/// <summary> /// Initializes a new instance of the <see cref="PlayerTwitterCard" /> 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 PlayerTwitterCard(string username, TwitterImage image, TwitterPlayer player) : base(username) { if (image == null) { throw new ArgumentNullException("image"); } if (player == null) { throw new ArgumentNullException("player"); } this._image = image; this._player = player; }
/// <summary> /// Initializes a new instance of the <see cref="PhotoTwitterCard"/> 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 PhotoTwitterCard(string username, TwitterImage image) : base(username) { if (image == null) { throw new ArgumentNullException("image"); } this._image = image; }
/// <summary> /// Initializes a new instance of the <see cref="GalleryTwitterCard" /> 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 GalleryTwitterCard(string username, TwitterImage image0, TwitterImage image1, TwitterImage image2, TwitterImage image3) : base(username) { if (image0 == null) { throw new ArgumentNullException("image0"); } if (image1 == null) { throw new ArgumentNullException("image1"); } if (image2 == null) { throw new ArgumentNullException("image2"); } if (image3 == null) { throw new ArgumentNullException("image3"); } this._image0 = image0; this._image1 = image1; this._image2 = image2; this._image3 = image3; }
/// <summary> /// Initializes a new instance of the <see cref="PlayerTwitterCard" /> 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 PlayerTwitterCard(string username, TwitterImage image, TwitterPlayer player) : base(username) { if (image == null) { throw new ArgumentNullException("image"); } if (player == null) { throw new ArgumentNullException("player"); } this._image = image; this._player = player; }
public async Task <FileStreamResult> Image(string id) { var profileImage = await TwitterImage.GetTwitterProfileImage(id); var templateStream = Assembly.GetExecutingAssembly() .GetManifestResourceStream(typeof(MvcApplication), "Twitter-Cover-Photo.jpg"); var template = System.Drawing.Image.FromStream(templateStream); var merged = Merge(template, profileImage); var ms = new MemoryStream(); merged.Save(ms, ImageFormat.Png); ms.Position = 0; return(new FileStreamResult(ms, "image/png")); }
// Se utiliza Sobrecarga (Tiene dos metodos Add con diferente firma). public void Add(Conductor conductor) { conductores.Add(conductor); cog.Recognize(conductor.Foto); if (cog.FaceFound && cog.SmileFound) { // Se aplica Creator , decidimos crear la instancia de TwitterImage aqui var twitter = new TwitterImage(consumerKey, consumerKeySecret, accessToken, accessTokenSecret); Console.WriteLine(twitter.PublishToTwitter(conductor.ImprimeDatos(), conductor.Foto)); Console.WriteLine("Se encuentra cara con Sonrisa de Conductor y se publica en Twitter"); } else { Console.WriteLine($"No cumple los requisitos para enviar Registro a Twitter"); } }
public void Add(Pasajero pasajero) { pasajeros.Add(pasajero); cog.Recognize(pasajero.Foto); if (pasajero.GetType().Equals(typeof(Pasajero)) && (cog.FaceFound)) { var twitter = new TwitterImage(consumerKey, consumerKeySecret, accessToken, accessTokenSecret); Console.WriteLine(twitter.PublishToTwitter(pasajero.ImprimeDatos(), pasajero.Foto)); Console.WriteLine("Encuentra Cara de Persona y se manda a Twitter"); } else { Console.WriteLine($"No cumple los requisitos para enviar Registro a Twitter"); } }
public UcuRideShare() { twitter = new TwitterImage(consumerKey, consumerKeySecret, accessToken, accessTokenSecret); persons = new List <Person>(); }
void ReleaseDesignerOutlets() { if (btnShare != null) { btnShare.Dispose(); btnShare = null; } if (Count != null) { Count.Dispose(); Count = null; } if (FacebookImage != null) { FacebookImage.Dispose(); FacebookImage = null; } if (FacebookSwitch != null) { FacebookSwitch.Dispose(); FacebookSwitch = null; } if (FacebookText != null) { FacebookText.Dispose(); FacebookText = null; } if (ReferralString != null) { ReferralString.Dispose(); ReferralString = null; } if (SelectText != null) { SelectText.Dispose(); SelectText = null; } if (ShareMessage != null) { ShareMessage.Dispose(); ShareMessage = null; } if (TwitterImage != null) { TwitterImage.Dispose(); TwitterImage = null; } if (TwitterSwitch != null) { TwitterSwitch.Dispose(); TwitterSwitch = null; } if (TwitterText != null) { TwitterText.Dispose(); TwitterText = null; } if (vBottomRightBasis != null) { vBottomRightBasis.Dispose(); vBottomRightBasis = null; } }