Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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];
            }
        }