2 using System.Collections.Generic;
 
    3 using System.ComponentModel;
 
    8 using System.Windows.Forms;
 
   10 namespace SeciUserInterface.Dialogs.Alerts
 
   24             InitializeComponent();
 
   26             for (
int i = 0; i < Seci.Managers.BlockMgr.Blocks.Count; ++i)
 
   28                 comBlocks.Items.Add(Seci.Managers.BlockMgr.Blocks[i].BlockName);
 
   34             if (!String.IsNullOrEmpty(Block))
 
   36                 comBlocks.SelectedItem = Block;
 
   37                 comBlocks.Enabled = 
false;
 
   39                 txtHigh.Text = OldHigh;
 
   40                 this.Text = 
"Edit Alert";
 
   46             if (comBlocks.SelectedIndex != -1)
 
   48                 var block = Seci.Managers.BlockMgr.Blocks[comBlocks.SelectedIndex];
 
   49                 var type = Seci.Managers.LabViewMgr.GetControlType(block.ParentVI, block.ReadControl);
 
   50                 lblType.Text = type.ToString();
 
   56             if (comBlocks.SelectedIndex == -1)
 
   58                 MessageBox.Show(
"Please select a Block");
 
   62             if (lblType.Text == 
"NUMERIC")
 
   64                 BlockType = Seci.Definitions.ControlType.NUMERIC.ToString();
 
   69                 if (!Double.TryParse(txtLow.Text, out low))
 
   71                     MessageBox.Show(
"Low limit must be numeric");
 
   75                 if (!Double.TryParse(txtHigh.Text, out high))
 
   77                     MessageBox.Show(
"High limit must be numeric");
 
   81                 Block = comBlocks.SelectedItem.ToString();
 
   85                     Low = high.ToString();
 
   86                     High = low.ToString();
 
   91                     High = high.ToString();
 
   96                 MessageBox.Show(
"Currently alerts can only be set for numeric blocks");
 
  102                 MessageBox.Show(
"This alert was loaded from a sub-configuration; the changes will not be saved in the sub-configuration");
 
  105             DialogResult = System.Windows.Forms.DialogResult.OK;
 
void AddAlert_Load(object sender, EventArgs e)
void comBlocks_SelectedIndexChanged(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)