コード例 #1
0
        /// <summary>
        /// DBを更新
        /// </summary>
        /// <returns></returns>
        public static bool UpdateDB()
        {
            _Instance?.Dispose();

            var conf = Configuration.GetConfiguration();

            var dbFilePath = conf["AppSettings:X4DBPath"];

            if (!Path.IsPathRooted(dbFilePath))
            {
                // DBファイルが相対パスの場合、実行ファイルのパスをベースにパスを正規化する
                var exeDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) ?? "";
                dbFilePath = Path.GetFullPath(Path.Combine(exeDir, conf["AppSettings:X4DBPath"]));
            }

            DataExportWindow.ShowDialog(GetX4InstallDirectory(), dbFilePath);

            if (File.Exists(dbFilePath))
            {
                _Instance = new X4Database(dbFilePath);
                InitX4DB();
                return(true);
            }

            return(false);
        }
コード例 #2
0
        private void MenuItemExport_OnClick(object sender, RoutedEventArgs e)
        {
            DataExportWindow window = new DataExportWindow();

            window.Show();
        }