private void button3_Click(object sender, RoutedEventArgs e) { this.button2.SetResourceReference(StyleProperty, "diamond"); this.button3.SetResourceReference(StyleProperty, "diamondactive"); this.button4.SetResourceReference(StyleProperty, "diamond"); this.button5.SetResourceReference(StyleProperty, "diamond"); this.button6.SetResourceReference(StyleProperty, "diamond"); this.dockPanel1.Visibility = Visibility.Hidden; this.dockPanel2.Visibility = Visibility.Visible; this.dockPanel3.Visibility = Visibility.Hidden; this.dockPanel4.Visibility = Visibility.Hidden; this.dockPanel5.Visibility = Visibility.Hidden; ObslugaBazy obs_baz = new ObslugaBazy(); List <String> ls = obs_baz.getLastHarmonogram(_szczegoly); double cmax = obs_baz.getLastCMax(); if (ls.Count < 1) { infoHarmonogram.Content = "Nie posiadamy przeliczonych harmonogramów."; pokazSzczegoly.Visibility = Visibility.Hidden; } else { tbharmonogram.Text = ""; String result = ls.ElementAt <String>(ls.Count - 1); infoHarmonogram.Content = "Oto ostatni przeliczony harmonogram: (cmax=" + cmax.ToString("f") + ")"; int i = 0; foreach (String x in ls) { i++; if (i % 2 == 1) //nieparzyste = mapa { Hyperlink hyperLink = new Hyperlink() { NavigateUri = new Uri(x) }; hyperLink.Inlines.Add("Link do mapy w googlemaps"); hyperLink.RequestNavigate += Hyperlink_RequestNavigate; tbharmonogram.Inlines.Add(hyperLink); tbharmonogram.Inlines.Add("\n"); //tbharmonogram.Inlines.Add(new Hyperlink(new Run(x))); } else // parzysta = opis trasy { tbharmonogram.Inlines.Add(x); } } pokazSzczegoly.Visibility = Visibility.Visible; } }
private void pokazSzczegoly_Click(object sender, RoutedEventArgs e) { ObslugaBazy obs_baz = new ObslugaBazy(); List <String> ls = obs_baz.getLastHarmonogram(!_szczegoly); tbharmonogram.Text = ""; if (_szczegoly) { _szczegoly = false; pokazSzczegoly.Content = "Pokaż szczegóły"; String result = ls.ElementAt <String>(ls.Count - 1); int i = 0; foreach (String x in ls) { i++; if (i % 2 == 1) //nieparzyste = mapa { Hyperlink hyperLink = new Hyperlink() { NavigateUri = new Uri(x) }; hyperLink.Inlines.Add("Link do mapy w googlemaps"); hyperLink.RequestNavigate += Hyperlink_RequestNavigate; tbharmonogram.Inlines.Add(hyperLink); tbharmonogram.Inlines.Add("\n"); //tbharmonogram.Inlines.Add(new Hyperlink(new Run(x))); } else // parzysta = opis trasy { tbharmonogram.Inlines.Add(x); } } } else { _szczegoly = true; pokazSzczegoly.Content = "Ukryj szczegóły"; String result = ls.ElementAt <String>(ls.Count - 1); int i = 0; foreach (String x in ls) { i++; if (i % 2 == 1) //nieparzyste = mapa { Hyperlink hyperLink = new Hyperlink() { NavigateUri = new Uri(x) }; hyperLink.Inlines.Add("Link do mapy w googlemaps"); hyperLink.RequestNavigate += Hyperlink_RequestNavigate; tbharmonogram.Inlines.Add(hyperLink); tbharmonogram.Inlines.Add("\n"); //tbharmonogram.Inlines.Add(new Hyperlink(new Run(x))); } else // parzysta = opis trasy { tbharmonogram.Inlines.Add(x); } } } }