private void Form7_Load(object sender, EventArgs e)
{
string filePath = System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini";
if (File.Exists(filePath))
{
string[] ini = File.ReadAllLines(filePath);
foreach (string s in ini)
{
if (s.StartsWith("commentString"))
{
switch (s.Split('=')[1])
{
case "//":
rdBtnBackSlash.Checked = true;
break;
case ";;":
rdBtnSemiColon.Checked = true;
break;
case "''":
rdBtnApostrophe.Checked = true;
break;
default:
rdBtnColon.Checked = true;
break;
}
}
else if (s.StartsWith("decompileMode"))
{
GroupBox g = (GroupBox)this.Controls["grpBoxDecMode"];
((RadioButton)(g.Controls["rdBtn" + s.Split('=')[1]])).Checked = true;
}
else if (s.StartsWith("numberDecompileMode"))
{
GroupBox g = (GroupBox)this.Controls["grpBoxNumberDecMode"];
((RadioButton)(g.Controls["rdBtn" + s.Split('=')[1]])).Checked = true;
}
}
}
else
{
rdBtnColon.Checked = true;
rdBtnNormal.Checked = true;
rdBtnHex.Checked = true;
}
}