| 1 |
using System; |
| 2 |
using System.Collections.Generic; |
| 3 |
using System.ComponentModel; |
| 4 |
using System.Data; |
| 5 |
using System.Drawing; |
| 6 |
using System.Linq; |
| 7 |
using System.Text; |
| 8 |
using System.Windows.Forms; |
| 9 |
|
| 10 |
namespace UT3_Server_Launcher |
| 11 |
{ |
| 12 |
public partial class FormPreferences : Form |
| 13 |
{ |
| 14 |
|
| 15 |
////////// |
| 16 |
// 定義 // |
| 17 |
////////// |
| 18 |
|
| 19 |
|
| 20 |
////////////////// |
| 21 |
// メンバー変数 // |
| 22 |
////////////////// |
| 23 |
|
| 24 |
string UT3BIN = string.Empty; |
| 25 |
string OPTION = string.Empty; |
| 26 |
|
| 27 |
|
| 28 |
public FormPreferences() |
| 29 |
{ |
| 30 |
InitializeComponent(); |
| 31 |
} |
| 32 |
|
| 33 |
private void FormPreferences_Load(object sender, EventArgs e) |
| 34 |
{ |
| 35 |
// プロパティの値を入力 |
| 36 |
txtBxUT3BIN.Text = Properties.Settings.Default.UT3BIN; |
| 37 |
|
| 38 |
// 設定値のバックアップを取る |
| 39 |
UT3BIN = Properties.Settings.Default.UT3BIN; |
| 40 |
OPTION = Properties.Settings.Default.OPTION; |
| 41 |
|
| 42 |
// キャンセルボタンにフォーカスを移動 |
| 43 |
this.ActiveControl = this.btnCancel; |
| 44 |
} |
| 45 |
|
| 46 |
private void btnOK_Click(object sender, EventArgs e) |
| 47 |
{ |
| 48 |
// 設定値を確定 |
| 49 |
Properties.Settings.Default.UT3BIN = txtBxUT3BIN.Text; |
| 50 |
this.Close(); |
| 51 |
} |
| 52 |
|
| 53 |
private void btnCancel_Click(object sender, EventArgs e) |
| 54 |
{ |
| 55 |
// バックアップから値を復元 |
| 56 |
Properties.Settings.Default.UT3BIN = UT3BIN; |
| 57 |
Properties.Settings.Default.OPTION = OPTION; |
| 58 |
|
| 59 |
this.Close(); |
| 60 |
} |
| 61 |
|
| 62 |
private void btnOpenFile_Click(object sender, EventArgs e) |
| 63 |
{ |
| 64 |
openFileDialog1.FileName = "UT3.exe"; |
| 65 |
openFileDialog1.InitialDirectory = UT3BIN; |
| 66 |
openFileDialog1.Filter = |
| 67 |
"execute file (*.exe)|*.exe|all files (*.*)|*.*"; |
| 68 |
openFileDialog1.FilterIndex = 1; |
| 69 |
openFileDialog1.Title = "Open"; |
| 70 |
openFileDialog1.RestoreDirectory = true; |
| 71 |
openFileDialog1.CheckPathExists = true; |
| 72 |
|
| 73 |
if (openFileDialog1.ShowDialog() == DialogResult.OK) |
| 74 |
{ |
| 75 |
txtBxUT3BIN.Text = openFileDialog1.FileName; // ユーザ表示用 |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
} |
| 80 |
} |