コード例 #1
0
        private void promptOpenFile()
        {
            OpenFileDialog dialog = new OpenFileDialog {
                InitialDirectory = System.IO.Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                    EsfSaveEditorControls.GameInfo.GetSetting("save_path") as string),
                RestoreDirectory = false
            };

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try {
                    OpenFile(dialog.FileName);
                } catch (Exception e) {
                    MessageBox.Show(string.Format("Could not open {0}: {1}", dialog.FileName, e));
                    updater.LoadingFinished();
                }
            }
        }