Ejemplo n.º 1
0
        /// <summary>
        /// Subscribe to the logger to listen in on when logs
        /// are being made.
        /// </summary>
        protected override void OnLoad()
        {
            logList        = GetControl <ITextList>("ConsoleList");
            commandTextBox = GetControl <ITextBox>("CommandTextBox");

            Log.OnLog += Log_OnLog;
            commandTextBox.OnSubmit += CommandTextBox_OnEndEdit;

            commandTextBox.Focus();
        }
Ejemplo n.º 2
0
    }//method

    private bool DoSearch(ITextBox textBox, string fragment, int start) {
      textBox.SelectionLength = 0;
      // Compile the regular expression.
      Regex r = new Regex(fragment, RegexOptions.IgnoreCase);
      // Match the regular expression pattern against a text string.
      Match m = r.Match(textBox.Text.Substring(start));
      if (m.Success) {
        int i = 0;
        Group g = m.Groups[i];
        CaptureCollection cc = g.Captures;
        Capture c = cc[0];
        textBox.SelectionStart = c.Index + start;
        textBox.SelectionLength = c.Length;
        textBox.Focus();
        textBox.ScrollToCaret();
        return true;
      }
      return false;
    }//method
Ejemplo n.º 3
0
 public new void Focus()
 {
     _box.Focus();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Fired each time the command textbox submits their
 /// input.
 /// </summary>
 /// <param name="sender">The textbox.</param>
 /// <param name="e">Nothing?.</param>
 private void CommandTextBox_OnEndEdit(object sender, EventArgs e)
 {
     ExecuteCommandAsync(commandTextBox.Text);
     commandTextBox.Clear();
     commandTextBox.Focus();
 }