private void SelectAgreeButton_Click(object sender, EventArgs e) { SelectClass selectClass = new SelectClass(); selectClass.SelectSet(SelectMsgLists, SelectJmpLists, (int)SelectNumericUpDown.Value); var jsonText = Newtonsoft.Json.JsonConvert.SerializeObject(selectClass); listBox1.Items.Add(jsonText); }
public void SelectDecode(string jsonText) { SelectClass selectClass = new SelectClass(); selectClass = Newtonsoft.Json.JsonConvert.DeserializeObject <SelectClass>(jsonText); SelectNumericUpDown.Value = selectClass.count; foreach (var i in Enumerable.Range(0, selectClass.count)) { SelectMsgLists[i].Text = selectClass.msg[i]; SelectJmpLists[i].Text = selectClass.jump[i]; } }