예제 #1
0
        private void DisplayMessageForm(bool isNew = true) {
            TextBoxForm textForm = new TextBoxForm();
            
            if (!isNew && messageOverrideValue.SelectedIndex != -1) {
                textForm.TextValue = (string)messageOverrideValue.Items[messageOverrideValue.SelectedIndex].ToString();
            }

            textForm.ShowDialog();
            
            if (textForm.DialogResult == System.Windows.Forms.DialogResult.OK) {
                if (messageOverrideValue.SelectedIndex > 0) {
                    messageOverrideValue.Items[messageOverrideValue.SelectedIndex] = textForm.TextValue;
                }
                else {
                    messageOverrideValue.Items.Add(textForm.TextValue);
                }
            }
            else if (textForm.DialogResult == System.Windows.Forms.DialogResult.Abort) {
                messageOverrideValue.Items.RemoveAt(messageOverrideValue.SelectedIndex);
            }
            else {
            }

            textForm.Close();
        }
예제 #2
0
파일: TriggerForm.cs 프로젝트: vadian/Novus
        private void DisplayMessageForm(bool isNew = true)
        {
            TextBoxForm textForm = new TextBoxForm();

            if (!isNew && messageOverrideValue.SelectedIndex != -1)
            {
                textForm.TextValue = (string)messageOverrideValue.Items[messageOverrideValue.SelectedIndex].ToString();
            }

            textForm.ShowDialog();

            if (textForm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                if (messageOverrideValue.SelectedIndex > 0)
                {
                    messageOverrideValue.Items[messageOverrideValue.SelectedIndex] = textForm.TextValue;
                }
                else
                {
                    messageOverrideValue.Items.Add(textForm.TextValue);
                }
            }
            else if (textForm.DialogResult == System.Windows.Forms.DialogResult.Abort)
            {
                messageOverrideValue.Items.RemoveAt(messageOverrideValue.SelectedIndex);
            }
            else
            {
            }

            textForm.Close();
        }
예제 #3
0
파일: ItemsTab.cs 프로젝트: vadian/Novus
 private void addToContainer_Click(object sender, EventArgs e)
 {
     TextBoxForm tbf = new TextBoxForm();
     tbf.ShowDialog();
     if (tbf.DialogResult == System.Windows.Forms.DialogResult.OK) {
         string values = ((TextBox)tbf.Controls["textBoxValue"]).Text;
         if (!itemContentsValue.Items.Contains(values)) {
             itemContentsValue.Items.Add(values);
         }
     }
     else if (tbf.DialogResult == System.Windows.Forms.DialogResult.Cancel) {
         //do nothing
     }
     else if (tbf.DialogResult == System.Windows.Forms.DialogResult.Abort) {
        //do nothing,because we don't delete from this form
     }
     tbf.Close();
 }
예제 #4
0
        private void addToContainer_Click(object sender, EventArgs e)
        {
            TextBoxForm tbf = new TextBoxForm();

            tbf.ShowDialog();
            if (tbf.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                string values = ((TextBox)tbf.Controls["textBoxValue"]).Text;
                if (!itemContentsValue.Items.Contains(values))
                {
                    itemContentsValue.Items.Add(values);
                }
            }
            else if (tbf.DialogResult == System.Windows.Forms.DialogResult.Cancel)
            {
                //do nothing
            }
            else if (tbf.DialogResult == System.Windows.Forms.DialogResult.Abort)
            {
                //do nothing,because we don't delete from this form
            }
            tbf.Close();
        }