public static PlainCommand GetPlainCommand(this ISeveralCommands payLoad, string name) { MethodInfo?method = payLoad.GetPrivateMethod(name); if (method == null) { Type type = payLoad.GetType(); throw new BasicBlankException($"Method with the name of {name} was not found Type was {type.Name}"); } PlainCommand output = new PlainCommand(payLoad, method, canExecuteM: null !, payLoad.Command); return(output); }
//this will do without the canexceute version. public static CustomBasicList <BoardCommand> GetBoardCommandList(this ISeveralCommands vm) { CustomBasicList <BoardCommand> output = new CustomBasicList <BoardCommand>(); Type type = vm.GetType(); CustomBasicList <MethodInfo> methods = type.GetMethods().ToCustomBasicList(); //decided to just show all methods period. //must have no methods.ForEach(x => { output.Add(new BoardCommand(vm, x, vm.Command, x.Name)); }); BoardCommand board = output.First(); return(output); }