示例#1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            DevicePara form = new DevicePara();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                if (Device == null)
                {
                    Device = new CommonMqttJsonObject();
                }
                Device.paras.Add(form.Pata);
                this.dataGridViewPara.DataSource = null;
                this.dataGridViewPara.DataSource = Device.paras;
            }
        }
示例#2
0
        private void btEdit_Click(object sender, EventArgs e)
        {
            if (this.dataGridViewPara.SelectedRows.Count <= 0)
            {
                return;
            }
            DevicePara form = new DevicePara();

            form.Pata = (CommonMqttJsonPara)this.dataGridViewPara.SelectedRows[0].DataBoundItem;
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                if (Device == null)
                {
                    Device = new CommonMqttJsonObject();
                }
            }
        }