protected static void TitleUpdate(Episod currenEpisods) { ITileWideImage tileContent = TileContentFactory.CreateTileWideImage(); tileContent.Image.Src = currenEpisods.posterPath; tileContent.RequireSquareContent = false; TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification()); }
void gvMain_SelectionChanged(object sender, SelectionChangedEventArgs e) { Selected = (Episod)gvMain.SelectedItem; if (Selected != null) { descriptionBox.Text = Selected.description; } }
public static bool Equals(Episod a, Episod b) { if (b == null) return false; if (a.episodTitle == b.episodTitle) return true; else return false; }
void show() { progressRing.IsActive = false; if (!Episod.Equals(EpisodsList.currentEpisods.First(), currentFirstEpisode)) { Notifications.Start(EpisodsList.currentEpisods.First()); gvMain.ItemsSource = EpisodsList.currentEpisods; InterfaceIsVisible(); currentFirstEpisode = EpisodsList.currentEpisods.First(); } }
protected static void NotificationSend(Episod currenEpisods) { IToastNotificationContent toastContent = null; IToastImageAndText03 templateContent = ToastContentFactory.CreateToastImageAndText03(); templateContent.TextHeadingWrap.Text = currenEpisods.showTitle + " - новая серия уже доступна."; templateContent.TextBody.Text = currenEpisods.episodTitle; templateContent.Image.Src = currenEpisods.imagePath; toastContent = templateContent; ToastNotification toast = toastContent.CreateNotification(); ToastNotificationManager.CreateToastNotifier().Show(toast); }
public static void EpisodFormat(Episod currentEpisod) { currentEpisod.episodTitle = clearFromHtml(currentEpisod.episodTitle); string pattern2 = "'"; Regex rgx2 = new Regex(pattern2); currentEpisod.id = rgx2.Replace(currentEpisod.id, ""); string pattern3 = ","; Regex rgx3 = new Regex(pattern3); currentEpisod.id = rgx3.Replace(currentEpisod.id, ", серия "); }
public async static Task<Episod> GetEpisodInfo(string html, int EpisodeLocation) { Episod currentEpisod = new Episod(); currentEpisod.showTitle = GetHtmlString("text-decoration:none\">", "</a></span>", html, EpisodeLocation); currentEpisod.episodTitle = GetHtmlString("span class=\"torrent_title\"><b>", "</b></span>", html, EpisodeLocation); currentEpisod.imagePath += GetHtmlString("img src=\"", "\" alt=\"", html, EpisodeLocation); currentEpisod.detailsPath += GetHtmlString("a href=\"", "\"><img src=", html, EpisodeLocation); currentEpisod.posterPath += GetHtmlString("img src=\"/Static/icons/cat_", "\" alt=\"", html, EpisodeLocation); string temp = GetHtmlString("ShowAllReleases", "\"></a>", html, EpisodeLocation); temp = temp.Substring(7, 8); currentEpisod.id += temp; EpisodFormat(currentEpisod); await Scraper.findDescription(currentEpisod); return currentEpisod; }
public async static Task scrap(string html) { List<int> indexes = new List<int>(); Episod temp = new Episod(); indexes = GetElementIndex(html, "text-decoration:none\">"); if (EpisodsList.currentEpisods.Count == 0) { foreach (var value in indexes) { EpisodsList.currentEpisods.Add(await GetEpisodInfo(html, value)); } return; } else { temp = await GetEpisodInfo(html, indexes.First()); if (!Episod.Equals(EpisodsList.currentEpisods.First(), temp)) EpisodsList.currentEpisods.Insert(0, temp); return; } }
public static void Start(Episod currenEpisods) { NotificationSend(currenEpisods); TitleUpdate(currenEpisods); }
public async static Task findDescription(Episod Selected) { string responce = await Request.getInfo(Selected.detailsPath); Selected.description = Scraper.GetHtmlString("font-weight: bold\">", "<div class=\"content\">", responce, 0); Selected.description = Scraper.GetHtmlString("<span>", "</span>", Selected.description, 0); Selected.description = clearFromHtml(Selected.description); string temp = Scraper.GetHtmlString("color:gray", "label", responce, 0); temp = Scraper.GetHtmlString("<span><b>", "</b>", responce, 0); Selected.rating += temp; }