private async void EditingModelForm_Load(object sender, EventArgs e)
        {
            await Loading?.Invoke();

            TB_Name.Focus();
            TB_Name.SelectionStart = TB_Name.TextLength;
        }
Beispiel #2
0
 private void BTN_BatchAdd_Click(object sender, EventArgs e)
 {
     if (TB_Name.Text != "")
     {
         bool        canadd  = true;
         XmlDocument doc     = CreateXMLDoc(TB_Name.Text);
         XmlNodeList inbatch = batch.SelectNodes("//Batch//Script[@Name='" + TB_Name.Text + "']");
         if (inbatch.Count > 0)
         {
             if (inbatch[0].InnerText != doc.SelectSingleNode("Script").InnerText)
             {
                 canadd = false;
                 if (MessageBox.Show("Step with the same name but different content already in list.  Press Yes to replace current step or No to cancel.\r\nTo add as a separate step, provide a unique name.", "Duplicate Step", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     XmlNode xn      = batch.ImportNode(doc.SelectSingleNode("Script"), true);
                     XmlNode oldnode = batch.SelectSingleNode("//Batch//Script[@Name='" + TB_Name.Text + "']");
                     oldnode.ParentNode.ReplaceChild(xn, oldnode);
                 }
             }
         }
         if (canadd)
         {
             LB_Batch.Items.Add(TB_Name.Text);
             XmlNode newscript = batch.ImportNode(doc.SelectSingleNode("Script"), true);
             batch.SelectSingleNode("Batch").AppendChild(newscript);
             BTN_BatchRun.Enabled  = true;
             BTN_SaveBatch.Enabled = true;
         }
     }
     else
     {
         MessageBox.Show("Batch step requires a name.");
         TB_Name.Focus();
     }
 }
Beispiel #3
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if (TC_Main.TabPages.Count >= 1)
     {
         TC_Main.TabPages.Remove(TP_Monitor);
         TC_Main.TabPages.Remove(TP_Product);
         TC_Main.TabPages.Remove(TP_Recipe);
     }
     TB_Name.Focus();
 }
Beispiel #4
0
 public MainForm()
 {
     InitializeComponent();
     TB_ipSetting.Text = PublicData.Ip;
     // TP_Monitor.en
     //   TP_Monitor.
     TC_Main.TabPages.Remove(TP_Monitor);
     TC_Main.TabPages.Remove(TP_Product);
     TC_Main.TabPages.Remove(TP_Recipe);
     TB_Name.Focus();
 }
        private void TB_Name_TextChanged(object sender, EventArgs e)
        {
            var regx = new Regex("[^a-zA-Z0-9 _]");

            if (regx.IsMatch(TB_Name.Text))
            {
                TB_Name.Text = name.Replace(" ", "_");
            }
            else
            {
                name = TB_Name.Text;
            }
            TB_Name.Focus();
            TB_Name.SelectionStart = TB_Name.Text.Length;
        }
Beispiel #6
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     TB_Name.Focus();
 }