public static ITwitterStatusUpdate Retweet(this ITwitterStatuses instance, TwitterStatus status, RetweetMode mode) { instance.Root.Parameters.Action = "update"; switch (mode) { case RetweetMode.Native: instance.Root.Parameters.Action = "retweet"; instance.Root.Parameters.Id = status.Id; break; case RetweetMode.SymbolPrefix: instance.Root.Parameters.Text = '\u2672'.ToString().Then(" ").Then(status.Text); break; case RetweetMode.Prefix: var rt = "@{0} {1}".FormatWith(status.User.ScreenName, status.Text); instance.Root.Parameters.Text = "RT ".Then(rt); break; case RetweetMode.Suffix: var via = "{1} (via @{0})".FormatWith(status.User.ScreenName, status.Text); instance.Root.Parameters.Text = via; break; default: throw new TweetSharpException("Unknown retweet mode specified."); } return new TwitterStatusUpdate(instance.Root); }
public static ITwitterStatusUpdate Retweet(this ITwitterStatuses instance, long statusId, RetweetMode mode) { return instance.Retweet(new TwitterStatus {Id = statusId}, mode); }