Ejemplo n.º 1
0
        public void ShowText(string text)
        {
            try
            {
                if (!text.StartsWith("\"") && !text.StartsWith("'"))
                {
                    textBox.Text = string.Empty;
                    escapeCharactersCheckBox.Checked = false;
                    textBox.Text = text;
                }
                else if (escapeCharactersCheckBox.Checked)
                {
                    textBox.Text = text;
                }
                else
                {
                    textBox.Text = NuGenHelperFunctions.ConvertEscapedCharacters(text, true);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("An exception occurred while trying to display the text:\n\n" + exception.ToString());
            }

            textBox.SelectionStart  = 0;
            textBox.SelectionLength = 0;

            textTab.SelectedTab = textEditorTabPage;
            ShowDialog();
        }
Ejemplo n.º 2
0
 private void escapeCharactersCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (escapeCharactersCheckBox.Checked)
         {
             textBox.Text = NuGenHelperFunctions.ShowEscapeCharacters(textBox.Text, true);
         }
         else
         {
             textBox.Text = NuGenHelperFunctions.ConvertEscapedCharacters(textBox.Text, true);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("An exception occurred while trying to display the text:\n\n" + exception.ToString());
     }
 }