Definition at line 292 of file AVR_DevConsole.cs. 297 from m in t.GetMethods(System.Reflection.BindingFlags.Static | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic))
307 if (result.method.GetParameters().Count() == 1 && result.method.GetParameters()[0].ParameterType == typeof(System.String))
309 System.Action<string> action = (System.Action<string>)System.Delegate.CreateDelegate(typeof(System.Action<string>), result.method);
310 register_command(att.getCommandString(), (args) => action(args[0]), att.getMinArgs(), att.getDescription());
314 System.Action<string[]> action = (System.Action<string[]>)System.Delegate.CreateDelegate(typeof(System.Action<string[]>), result.method);
319 System.Action action = (System.Action)System.Delegate.CreateDelegate(typeof(System.Action), result.method);
320 register_command(att.getCommandString(), (args) => action(), att.getMinArgs(), att.getDescription());
324 error("Following method is marked as ConsoleCommand, but doesnt follow the necessary requirements: " + result.method + "\n It needs to be static and void. Parameters have to be either none, a single string or a single array of strings.");
static void error(string s) Print a given error string on the console. Definition: AVR_DevConsole.cs:180 static void register_command(AVR_ConsoleCommand cmd) Registers a new command to the console. Definition: AVR_DevConsole.cs:266 This attribute can be used to easily make a function into a command runnable through the AVR_DevConso... Definition: AVR_Attributes.cs:42 |