private Section LoadSection() { Stream str = null; OpenFileDialog LoadWindow = new OpenFileDialog() { InitialDirectory = "c:\\Pulpit", Filter = "All files (*.*)|*.*|JPG (*.jpg)|*.jpg", FilterIndex = 2, RestoreDirectory = true }; try { LoadWindow.ShowDialog(); str = LoadWindow.OpenFile(); if (str != null) { Bitmap img = new Bitmap(str); StringPackage pac = new StringPackage(""); NewName newName = new NewName(pac); newName.ShowDialog(); Section sec = new Section(pac.Content, img); AddToList(sec); return(sec); } } catch { return(null); } return(null); }
private void OnNewNameButtonClick(object sender, RoutedEventArgs e) { StringPackage pac = new StringPackage(""); NewName newName = new NewName(pac); newName.ShowDialog(); string na = pac.Content; if (!na.Contains(".kml")) { na += ".kml"; } ((Kml)ChosenFile.Root).Feature.Name = na; }
private void OnMakeProfileButtonClick(object sender, RoutedEventArgs e) { Profile profile = new Profile(); profile.ProfKmlFile = ChosenFile; ChooseSectionWindow chooseSectionWindow = new ChooseSectionWindow(profile); foreach (Section i in SectionCollection) { FileButton <Section> button = new FileButton <Section>(i); button.Margin = new Thickness(10, 5, 5, 10); button.Content = i.Name; button.Click += chooseSectionWindow.OnButtClick; chooseSectionWindow.Stack.Children.Add(button); } chooseSectionWindow.ShowDialog(); StringPackage pac = new StringPackage(""); NewName newName = new NewName(pac); newName.ShowDialog(); profile.Name = pac.Content; AddToList(profile); }