Example #1
0
 private void btnAddMessage_Click(object sender, EventArgs e)
 {
     try {
         CANMessage     msgInsert = new CANMessage();
         FrmEditMessage frme      = new FrmEditMessage(msgInsert);
         frme.ShowDialog();
         if (frme.modified)
         {
             config.AppendMessage(msgInsert);
             reloadDisplay();
         }
     }catch (Exception ex) {
         MessageBox.Show("信号量增加出错:" + ex.Message, "错误提示",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 private void btnEditMessage_Click(object sender, EventArgs e)
 {
     try {
         TreeNode tnSelected = MessageTreeView.SelectedNode;
         if (typeof(CANMessage).Equals(tnSelected.Tag.GetType()))
         {
             FrmEditMessage frme = new FrmEditMessage(
                 (CANMessage)tnSelected.Tag
                 );
             frme.ShowDialog();
             refreshDisplay();
         }
         else if (typeof(CANSignal).Equals(tnSelected.Tag.GetType()))
         {
         }
     } catch { }
 }