public static string GetNewsFeedImage(NewsFeedType type) { switch (type) { case NewsFeedType.NewProblem: return("/site/images/page_white_add.png"); case NewsFeedType.SolvedProblem: return("/site/images/problemsolved.gif"); case NewsFeedType.ShortestSolution: return("/site/images/text_letter_omega.png"); case NewsFeedType.CodeSnippet: return("/site/images/page_white_zip.png"); case NewsFeedType.News: return("/site/images/newnews.jpg"); case NewsFeedType.ForumPost: case NewsFeedType.SourcePost: case NewsFeedType.ProblemPost: return("/site/images/newpost.gif"); case NewsFeedType.NewContest: return("/site/images/contest.gif"); case NewsFeedType.FirstUserFromSchool: return("/site/images/user_add.png"); } return(String.Empty); }
public static string GetNewsFeedLink(NewsFeedType type) { switch (type) { case NewsFeedType.NewProblem: break; case NewsFeedType.SolvedProblem: return("View problem description"); case NewsFeedType.ShortestSolution: break; case NewsFeedType.CodeSnippet: return("Check out this code snippet"); case NewsFeedType.News: break; case NewsFeedType.ForumPost: break; case NewsFeedType.SourcePost: break; case NewsFeedType.ProblemPost: break; case NewsFeedType.NewContest: break; default: break; } return(String.Empty); }
async public static Task <List <Status> > GetNewsFeed(int page = 1, long?skip = null, int count = 20, bool skipAnnouncement = true, NewsFeedType list = NewsFeedType.Global) { var path = BASE.AppendPathSegments("List", "Newsfeed"); switch (list) { case NewsFeedType.Global: path.AppendPathSegment("Global"); break; case NewsFeedType.Local: path.AppendPathSegment("Local"); break; } if (skip.HasValue) { path.SetQueryParam("skip", skip.Value); } if (skipAnnouncement) { count++; } path.SetQueryParam("page", page); path.SetQueryParam("count", count); var statuses = (await path.GetJsonAsync <StatusRoot>()).Statuses; if (skipAnnouncement) { statuses.RemoveAll(x => x.IsNotification == true); } return(statuses); }
protected string GetImage(object type) { NewsFeedType feedType = (NewsFeedType)type; return(FormatHelper.GetNewsFeedImage(feedType)); }