private void Editor_KeyPress(object sender, KeyPressEventArgs e) { try { if (AutoComplete) { switch (e.KeyChar) { case '.': EditionTextBox.SelectedText = e.KeyChar.ToString(CultureInfo.InvariantCulture); e.Handled = true; DisplayComboBox(); break; case '{': Structure structure = GetInstance(EditionTextBox.SelectionStart - 1) as Structure; if (structure != null) { TextualExplanation text = new TextualExplanation(); text.WriteLine("{"); CreateDefaultStructureValue(text, structure, false); EditionTextBox.SelectedText = text.Text; EditionTextBox.ProcessAllLines(true); e.Handled = true; } break; case '(': ICallable callable = GetInstance(EditionTextBox.SelectionStart - 1) as ICallable; if (callable != null) { TextualExplanation text = new TextualExplanation(); CreateCallableParameters(text, callable); EditionTextBox.SelectedText = text.Text; EditionTextBox.ProcessAllLines(true); e.Handled = true; } break; case '>': case '-': char prev = EditionTextBox.Text[EditionTextBox.SelectionStart - 1]; if ((prev == '<' && e.KeyChar == '-') || (prev == '=' && e.KeyChar == '>')) { ITypedElement typedElement = GetInstance(EditionTextBox.SelectionStart - 2) as ITypedElement; if (typedElement != null) { EditionTextBox.SelectedText = e.KeyChar + " " + typedElement.Type.FullName; e.Handled = true; } } break; } } } catch (Exception) { } }
public void Redo() { EditionTextBox.Redo(); EditionTextBox.ProcessAllLines(); }
public void Paste() { EditionTextBox.Paste(); EditionTextBox.ProcessAllLines(); }
public void Undo() { EditionTextBox.Undo(); EditionTextBox.ProcessAllLines(); }
public void Cut() { EditionTextBox.Cut(); EditionTextBox.ProcessAllLines(); }