Example #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            SensorForm sf = new SensorForm(site, null);

            if (DialogResult.OK == sf.ShowDialog())
            {
                site.Add(sf.sensor);
                RefreshList();
            }
        }
Example #2
0
        private void buttonModify_Click(object sender, EventArgs e)
        {
            if (listViewSensors.SelectedItems.Count <= 0)
            {
                return;
            }
            uint   num = Convert.ToUInt32(listViewSensors.SelectedItems[0].Text);
            Sensor ss;

            if (!site.Get(num, out ss))
            {
                return;
            }
            SensorForm sf = new SensorForm(site, ss);

            if (DialogResult.OK == sf.ShowDialog())
            {
                site.Delete(num);
                site.Add(sf.sensor);
                RefreshList();
            }
        }