Beispiel #1
0
        private async void OpenJsonButton_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new System.Windows.Forms.OpenFileDialog
            {
                Filter = "Jsonファイル|*.json"
            };

            openFileDialog.ShowDialog();
            var fileName = openFileDialog.FileName;

            if (SaveFileReader.TryGetIdInFileName(Path.GetFileName(fileName), out var n))
            {
                if (n > 0 && n < 6)
                {
                    var data = await SaveFileReader.ReadSpecialJsonDataAsync(fileName);

                    var trainDataFileViewer = new TrainDataFileViewer();
                    trainDataFileViewer.RenderData(data.First());
                    trainDataFileViewer.Show();
                }
                else
                {
                    var data = await SaveFileReader.ReadJsonDataAsync(fileName);

                    var trainDataFileViewer = new TrainDataFileViewer();
                    trainDataFileViewer.RenderData(data);
                    trainDataFileViewer.Show();
                }
            }
        }