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

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