Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mnuDeviceAdd_Click(object sender, EventArgs e)
        {
            Station station = GetSelectedStation();

            if (station != null)
            {
                frmDeviceSelect fDeviceSelect = new frmDeviceSelect();
                DialogResult    drds          = fDeviceSelect.ShowDialog(this);
                if (drds == DialogResult.OK)
                {
                    string        newDeviceType = fDeviceSelect.SelectedDeviceType;
                    frmDeviceItem f             = new frmDeviceItem(station, newDeviceType);
                    DialogResult  dr            = f.ShowDialog();
                    if (dr == DialogResult.OK)
                    {
                        // update treeview
                        //
                        AddDeviceToStationTreeNode(this.tvStation.SelectedNode, f.Device);
                    }
                }
            }
            else
            {
                NUnit.UiKit.UserMessage.DisplayFailure(strings.PleaseSelectStation);
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mnuDeviceEdit_Click(object sender, EventArgs e)
        {
            Device device = GetSelectedDevice();

            if (device != null)
            {
                frmDeviceItem f = new frmDeviceItem(device);
                f.ShowDialog();
            }
            else
            {
                ShowNeedSelectDeviceMessage();
            }
        }