C# Debug Console creation
Hey all!
Right now I'm working in C#, and I want it so that if a user presses '~' in my input text box, it will make the next input become a direct function.
for example:
Code:
class Form1 : Form
{
#region unnecessary
#endregion
bool functions;
private void on_textbox_keyentry(Object sender, KeyEventArgs e)
{
switch(e.KeyChar())
{
case '~':
//code to run the function whos name matches the input example
//What follows is meta-code
functions = true;
break;
}
}
private void handle_text()//this gets called by pressing enter
// or pressing the enter button @ the textBox_input()
{
string inp = textBox_input.Text;
if(!functions)
input(inp); //this parses regular input
else
{
rFunc(inp); //this should run functions
functions = false; //reset it
}
}
#region input
//input function
#endregion
private void rFunc(string inp)
{
//What to put here?
}
};
Right now I see no way of doing this, but there must be a way, considering debug consoles exist. Please help.