public override void Process(TagHelperContext context, TagHelperOutput output) { output.TagName = "a"; output.TagMode = TagMode.StartTagAndEndTag; string UrlText = "https://twitter.com/" + ScreenName + "/status/" + TweetId.ToString(); output.Attributes.SetAttribute("href", UrlText); output.Attributes.SetAttribute("rel", "nofollow"); output.Content.SetContent(UrlText); }
public override string ToString() { StringBuilder returnStr = new StringBuilder(); returnStr.Append("TweetItem:\n"); returnStr.Append("{TweetId=" + TweetId.ToString()); returnStr.Append(", AuthorScreenName='" + AuthorScreenName + "'"); returnStr.Append(", CreatedAt=[" + CreatedAt.ToString("yyyy-MM-dd hh:mm:ss") + "]"); returnStr.Append(", TweetText={'" + TweetText + "}'"); returnStr.Append(", URL=" + URL); if (mediaItems.Count > 0) { returnStr.Append(", Media=["); foreach (MediaItem item in mediaItems) { returnStr.Append("{" + item.ToString() + "},"); } returnStr.Remove(returnStr.Length - 1, 1); returnStr.Append("]"); } if (InReplyToStatusId != null) { returnStr.Append(", InReplyToStatusId=" + InReplyToStatusId.ToString()); returnStr.Append(", InReplyToScreenName='" + InReplyToScreenName + "'"); } if (QuotedStatusId != null) { returnStr.Append(", QuotedStatusId=" + QuotedStatusId.ToString()); returnStr.Append(", QuotedScreenName='" + QuotedScreenName + "'"); } returnStr.Append("}"); return(returnStr.ToString()); }
public override int GetHashCode() { return(TweetId.GetHashCode()); }