Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 2
0
 private static bool?IsAreaData(string filePath)
 {
     if (SaveFileReader.TryGetIdInFileName(filePath, out var id))
     {
         return(id > 0 && id < 6);
     }
     else
     {
         return(null);
     }
 }