Exemplo n.º 1
0
		private void OnNewsReceived(CommunityNews news)
		{
			var now = DateTime.UtcNow;

			_news.RemoveWhere(n => n.EndDate <= now);

			if (GetContent(news).IsEmpty())
				return;

			_news.Add(news);

			_index = 0;
			ShowNews();
		}
Exemplo n.º 2
0
		private void OnNewsReceived(CommunityNews news)
		{
			var now = DateTime.UtcNow;

			lock (_news.SyncRoot)
			{
				_news.RemoveWhere(n => n.EndDate <= now);

				if (GetContent(news).IsEmpty())
					return;

				_news.Add(news);
				_index = 0;
			}

			this.GuiAsync(() => ShowNews(news));
		}
Exemplo n.º 3
0
		private static string GetContent(CommunityNews news)
		{
			var isRu = LocalizedStrings.ActiveLanguage == Languages.Russian;
			return isRu ? news.RussianBody : news.EnglishBody;
		}
Exemplo n.º 4
0
		private void ShowNews(CommunityNews news)
		{
			HtmlPanel.Text = _parser.ToHtml(GetContent(news));
		}