private async void ButtonBrowser_OnClickAsync(object sender, RoutedEventArgs e) { FileExplorer fileExplorer = new FileExplorer(fileExplorerFilter, true); OpenFile = fileExplorer.Open(Environment.SpecialFolder.Desktop); if (fileExplorer.verificate) { isDataDirty = true; TextBoxPathToPhoto.Text = string.Empty; TextBoxPhotoName.Text = string.Empty; StackPanelPhotoContainer.Children.Clear(); foreach (string fileName in OpenFile.FileNames) { Image image = await CreateImage(fileName); StackPanel stack = new StackPanel(); Grid grid = await CreateGrid(GetString.OneStringFromPath(fileName)); stack.Children.Add(image); stack.Children.Add(grid); StackPanelPhotoContainer.Children.Add(stack); } TextBoxPathToPhoto.Text = await CreateString.StringManyPhotoName(OpenFile.FileNames); TextBoxPhotoName.Text = await CreateString.StringManyPhotoName(await GetString.StringListFromPathListTask(OpenFile.FileNames)); } }
} //skończone private void SearchProgramPathButton_Click(object sender, RoutedEventArgs e) { FileExplorer file = new FileExplorer("EXE (*.exe)|*.exe", false); var filename = file.Open(Environment.SpecialFolder.MyComputer); if (file.verificate) { isDataDirty = true; SaveOptionButton.IsEnabled = true; SourceEditingProgramTextBox.Text = filename.FileName; } }
//poprawić wyciąganie danych z pliku #region Photo /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddPhotoButton_Click(object sender, RoutedEventArgs e) { FileExplorer fileExplorer = new FileExplorer("JPG (*.jpg)|*.jpg|TIFF (*.tiff)|*.tiff|PNG (*.png)|*.png", true); Microsoft.Win32.OpenFileDialog file = fileExplorer.Open(Environment.SpecialFolder.Desktop); if (fileExplorer.verificate) { foreach (string item in file.FileNames) { string s = Convert.ToString(item); MessageBox.Show(s); } } }
private void AddPhotoButton_Click(object sender, RoutedEventArgs e) { FileExplorer fileExplorer = new FileExplorer("JPEG (*.jpg)|*.jpg|PNG (*.png)|*.png|TIFF (*.tiff)|*.tiff", true); var files = fileExplorer.Open(Environment.SpecialFolder.Desktop); if (fileExplorer.verificate == true) { foreach (var fileName in files.FileNames) { FileInfo file = new FileInfo(fileName); Image image = new Image(); image.HorizontalAlignment = HorizontalAlignment.Center; image.VerticalAlignment = VerticalAlignment.Center; image.Margin = new Thickness(3); image.Stretch = Stretch.Uniform; image.Source = new BitmapImage(new Uri(file.FullName)); SliderStackPanel.Children.Add(image); } } } //dokończyć