/// <summary> /// Funcao auxiliar para quebrar a informação baixada do site para algo legível no app. /// </summary> /// <param name="_info">Html tag com as informações</param> public void ProcessInfo() { ProcessHelper ph = new ProcessHelper(); ph.ProcessInfo(this.Info, this.Periodo); }
internal void LoadInfo() { ProcessHelper ph = new ProcessHelper(); ph.ProcessInfo(wupdater.Info, wupdater.Periodo); pivot.Items.Clear(); foreach (var Dia in ph.Semana) { PivotItem aba = new PivotItem { Header = Dia.NomeDoDia() }; ScrollViewer sv_dia = new ScrollViewer(); StackPanel stack_refeicoes = new StackPanel(); sv_dia.Content = stack_refeicoes; TextBlock data = new TextBlock { Text = string.Format("Dia {0}/{1}", Dia.Data.Day, Dia.Data.Month) }; stack_refeicoes.Children.Add(data); if (!String.IsNullOrEmpty(Dia.Desjejum)) AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Desjejum); if (!String.IsNullOrEmpty(Dia.Almoco)) AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Almoço); if (!String.IsNullOrEmpty(Dia.Jantar)) AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Jantar); sv_dia.Style = (Style)App.Current.Resources["AbaDiaDaSemana"]; aba.Content = sv_dia; pivot.Items.Add(aba); if (Dia.Data.DayOfWeek == DateTime.Today.DayOfWeek) { pivot.SelectedItem = aba; AdControl ad = new AdControl("74e1a034-5680-4210-808c-52463e8bbcf1", "162701", true) { IsAutoCollapseEnabled = true, Margin = new Thickness(12), Width = 300, Height = 50 }; #if DEBUG ad.ErrorOccurred += ad_ErrorOccurred; #endif stack_refeicoes.Children.Add(ad); } } }
internal void LoadInfo() { ProcessHelper ph = new ProcessHelper(); ph.ProcessInfo(wupdater.Info, wupdater.Periodo); pivot.Items.Clear(); foreach (var Dia in ph.Semana) { PivotItem aba = new PivotItem { Header = Dia.NomeDoDia() }; ScrollViewer sv_dia = new ScrollViewer(); StackPanel stack_refeicoes = new StackPanel(); sv_dia.Content = stack_refeicoes; TextBlock data = new TextBlock { Text = string.Format("Dia {0}/{1}", Dia.Data.Day, Dia.Data.Month) }; stack_refeicoes.Children.Add(data); if (!String.IsNullOrEmpty(Dia.Desjejum)) { AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Desjejum); } if (!String.IsNullOrEmpty(Dia.Almoco)) { AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Almoço); } if (!String.IsNullOrEmpty(Dia.Jantar)) { AdicionaRefeicao(Dia, stack_refeicoes, Refeicao.Jantar); } sv_dia.Style = (Style)App.Current.Resources["AbaDiaDaSemana"]; aba.Content = sv_dia; pivot.Items.Add(aba); if (Dia.Data.DayOfWeek == DateTime.Today.DayOfWeek) { pivot.SelectedItem = aba; AdControl ad = new AdControl("74e1a034-5680-4210-808c-52463e8bbcf1", "162701", true) { IsAutoCollapseEnabled = true, Margin = new Thickness(12), Width = 300, Height = 50 }; #if DEBUG ad.ErrorOccurred += ad_ErrorOccurred; #endif stack_refeicoes.Children.Add(ad); } } }