예제 #1
0
        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);
        }
예제 #2
0
        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());
        }
예제 #3
0
 public override int GetHashCode()
 {
     return(TweetId.GetHashCode());
 }