コード例 #1
0
        private void LoadCsvButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Csv files (*.csv)|*.csv|Text files (*.txt)|*.txt";
            if (openFileDialog.ShowDialog() == true)
            {
                try
                {
                    string fileName = openFileDialog.FileName;
                    clusterData = RawDataReader.ReadFromCsv(fileName, ';');
                    RefreshInputGrid();
                }
                catch
                {
                    MessageBox.Show("Failed to load csv - wrong Format?", "Loading failed.", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }