Example #1
0
        /// <summary>
        /// モデルの読み込み
        /// </summary>
        private void InputFileNameButton_Click(object sender, RoutedEventArgs e)
        {
            UpdatePhase(ExecutePhase.DataReading);

            OpenFileDialog ofd = new OpenFileDialog
            {
                InitialDirectory = "Resources",
                FileName         = "",
                DefaultExt       = "*.*",
                Filter           = "CSVファイル|*.csv",
            };

            var ret = ofd.ShowDialog();

            if (ret.HasValue && ret.Value)
            {
                var filePath = ofd.FileName;
                InputFileNameLabel.Content = ofd.SafeFileName;

                var datas = CsvUtility.ReadCsv(filePath, true);

                _cityList.Clear();
                _cityList = ModelUtility.GetAllCitiesModel(datas).ToList();
            }

            DrawCities();

            UpdatePhase(ExecutePhase.Setting);
        }