Exemplo n.º 1
0
 /// <summary>
 /// Add new action.
 /// </summary>
 private void addToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     try
     {
         GXDLMSScriptAction    a   = new GXDLMSScriptAction();
         GXDLMSScriptActionDlg dlg = new GXDLMSScriptActionDlg(a, targets);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             ShowAction(a, null);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Edit action.
 /// </summary>
 private void editToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         if (Actions.SelectedItems.Count == 1)
         {
             GXDLMSScriptAction    a   = Actions.SelectedItems[0].Tag as GXDLMSScriptAction;
             GXDLMSScriptActionDlg dlg = new GXDLMSScriptActionDlg(a, targets);
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 ShowAction(a, Actions.SelectedItems[0]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }