-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVCJE_Config.cs
144 lines (111 loc) · 5.79 KB
/
VCJE_Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
/* ==== VirtualCastEditorフォーム ==== */
namespace VirtualCastJsonEditor
{
/* ==== VCJE_Config ==== */
public partial class VCJE_Config : Form
{
/*===========================================================================*/
/* イニシャライズ */
/*===========================================================================*/
public VCJE_Config()
{
InitializeComponent();
/* ==== Steam選択ラジオボタン初期化 ==== */
SteamRadioButton.Checked = Properties.Settings.Default.SteamSelect;
/* ==== VirtualCastのパス ==== */
ProjectFileBox.Text = Properties.Settings.Default.DLPass;
/* ==== XMLのラジオボタン初期化 ==== */
XML_RadioButton.Checked = Properties.Settings.Default.OpenXML;
/* ==== Jsonのラジオボタン初期化 ==== */
Json_RadioButton.Checked = Properties.Settings.Default.OpenJson;
/* ==== NoneFileのラジオボタン初期化 ==== */
NoneFile_RadioButton.Checked = Properties.Settings.Default.NoneFile;
if (SteamRadioButton.Checked != true)
{
DLRadioButton.Checked = true;
}
/* ==== DL版VirtualCastのパスコントロール ==== */
DLPassSelect();
}
/*===========================================================================*/
/* メインフォーム */
/*===========================================================================*/
/* ==== DL版VirtualCastのパスコントロール ==== */
private void DLPassSelect ()
{
ProjectFileBox.Enabled = !SteamRadioButton.Checked;
button1.Enabled = ProjectFileBox.Enabled;
}/* ==== END_DL版VirtualCastのパスコントロール ==== */
/* ==== OKボタン ==== */
private void CancelButton_Click(object sender, EventArgs e)
{
Close();
}/* ==== END_OKボタン ==== */
/* ==== ProjectFileボタンクリックイベント ==== */
private void SelectProjectFile_MouseUp(object sender, EventArgs e)
{
/* FolderBrowserDialogを表示 */
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
/* ユーザーが選択したフォルダをテキストボックスに表示 */
ProjectFileBox.Text = folderBrowserDialog1.SelectedPath;
} /* END_FolderBrowserDialogを表示 */
}/* ==== END_ProjectFileボタンクリックイベント ==== */
/* ==== 適応ボタンイベント ==== */
private void ApplyButton_Click(object sender, EventArgs e)
{
/* ==== Steam選択ラジオボタン初期化 ==== */
Properties.Settings.Default.SteamSelect = SteamRadioButton.Checked;
/* ==== DL版VirtualCastのパス ==== */
Properties.Settings.Default.DLPass = ProjectFileBox.Text;
/* ==== XMLのラジオボタン適応 ==== */
Properties.Settings.Default.OpenXML = XML_RadioButton.Checked;
/* ==== Jsonのラジオボタン適応 ====*/
Properties.Settings.Default.OpenJson = Json_RadioButton.Checked;
/* ==== NoneFileのラジオボタン適応 ==== */
Properties.Settings.Default.NoneFile = NoneFile_RadioButton.Checked;
/* ==== 設定をアプリケーションに保存します。 ==== */
Properties.Settings.Default.Save();
/* ==== VirtualCast保存先セレクター ==== */
if (SteamRadioButton.Checked == true)
{/* ==== Steamをセレクト ==== */
Properties.Settings.Default.LocalPass = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\My Games\VirtualCast";
}
else
{/* ==== DL版をセレクト ==== */
Properties.Settings.Default.LocalPass = Properties.Settings.Default.DLPass;
}/* ==== END_VirtualCast保存先セレクター ==== */
/* ==== 設定をアプリケーションに保存します。 ==== */
Properties.Settings.Default.Save();
}/* ==== 適応ボタンイベント ==== */
/* ==== 初期化イベント ==== */
private void InitializeButton_Click(object sender, EventArgs e)
{
/* ==== Steam選択ラジオボタン初期化 ==== */
SteamRadioButton.Checked = true;
/* ==== VirtualCastのパス ==== */
ProjectFileBox.Text = "";
/* ==== XMLのラジオボタン初期化 ==== */
XML_RadioButton.Checked = true;
/* ==== Jsonのラジオボタン初期化 ====*/
Json_RadioButton.Checked = false;
/* ==== NoneFileのラジオボタン初期化 ==== */
NoneFile_RadioButton.Checked = false;
}/* ==== END_初期化イベント ==== */
/* ==== SteamLDSelectイベント ==== */
private void SteamRadioButton_CheckedChanged(object sender, EventArgs e)
{
DLPassSelect();
}/* ==== SteamLDSelectイベント ==== */
}/* ==== END_VCJE_Config ==== */
}/* ==== END_VirtualCastJsonEditorフォーム ==== */