public void OnOpenFileForRemoteImageCollection() { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Filter = "csv files (*.csv)|*.csv"; fileDialog.ShowDialog(); if (fileDialog.CheckFileExists && fileDialog.FileName != "") { try { var remoteImages = RemoteImage.ReadRemoteImagesFromFile(fileDialog.FileName); remoteImages.ForEach((remoteImage) => { RemoteImageCollection.Add(remoteImage); }); } catch { MessageBox.Show("Помилка CSV файлу, будь ласка, перевірте CSV файл!", "Перевірте CSV файл"); } } }
public void OnOpenFileForRemoteImageCollection() { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Filter = "csv files (*.csv)|*.csv"; fileDialog.ShowDialog(); if (fileDialog.CheckFileExists && fileDialog.FileName != "") { try { var remoteImages = RemoteImage.ReadRemoteImagesFromFile(fileDialog.FileName); remoteImages.ForEach((remoteImage) => { RemoteImageCollection.Add(remoteImage); }); } catch { MessageBox.Show("CSV File Error, Please Check the CSV File for Errors!", "Check CSV"); } } }