Exemple #1
0
 public SubredditImage(Reddit reddit, SubredditStyle subredditStyle,
                       string cssLink, string name, IWebAgent webAgent)
 {
     Reddit         = reddit;
     WebAgent       = webAgent;
     SubredditStyle = subredditStyle;
     Name           = name;
     CssLink        = cssLink;
 }
Exemple #2
0
        public SubredditImage(Reddit reddit, SubredditStyle subreddit,
                              string cssLink, string name, string url, IWebAgent webAgent)
            : this(reddit, subreddit, cssLink, name, webAgent)
        {
            Url = new Uri(url);
            // Handle legacy image urls
            // http://thumbs.reddit.com/FULLNAME_NUMBER.png
            int discarded;

            if (int.TryParse(url, out discarded))
            {
                Url = new Uri(string.Format("http://thumbs.reddit.com/{0}_{1}.png", subreddit.Subreddit.FullName, url), UriKind.Absolute);
            }
        }