//-------------------------------------------------------------------------------------- public void PrefSave() { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetInt("Height", this.Height); pref.SetIntArray("ParamsInt", tsGrid1.tsd.ParamsInt); pref.SetBoolArray("ParamsBool", tsGrid1.tsd.ParamsBool); pref.SetIntArray("Colors", tsGrid1.cols.ColorInt); pref.SetIntArray("Keys", tsGrid1.funcs.FuncTableAll); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetString("TargetDir", iconButtonList1.TargetDir); pref.SetSize("ButtonSize", iconButtonList1.ButtonSize); int[] cols = new int[3]; cols[0] = iconButtonList1.ForeColor.ToArgb(); cols[1] = iconButtonList1.BackColor.ToArgb(); pref.SetIntArray("Color", cols); pref.SetString("Font", iconButtonList1.Font.Name); pref.SetDouble("FontSize", (double)iconButtonList1.Font.Size); pref.SetInt("FontStyle", (int)iconButtonList1.Font.Style); pref.SetBool("RelativePath", iconButtonList1.RelativePath); pref.Save(); iconButtonList1.BackupStore(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetIntArray("IntArray", new int[] { 8, 9, 7 }); pref.Save(); }
private void button1_Click(object sender, EventArgs e) { JsonPref j = new JsonPref(); int[] aaa = new int[] { 78, 9, 12 }; double[] bbb = new double[] { 0.7, 0.01, 0.12 }; string[] ccc = new string[] { "eee", "sfskjbF", "13" }; j.SetIntArray("aa", aaa); j.SetDoubleArray("bb", bbb); j.SetStringArray("cc", ccc); MessageBox.Show(j.ToJson()); }