Salut à tous,
Les méthodes "Command" et "CommanAsync" n'existent pas dans la classe ZwSoft.ZwCAD.EditorInput.Editor :
J'ai trouvé sur le net un bout de code permettant de refaire la méthode "Command" :
public static PromptStatus Command(this Editor ed, params object[] args)
{
if (ed == null)
throw new ArgumentNullException("ed");
return runCommand(ed, args);
}
static Func<Editor, object[], PromptStatus> runCommand = GenerateRunCommand();
static Func<Editor, object[], PromptStatus> GenerateRunCommand()
{
MethodInfo method = typeof(Editor).GetMethod(
"RunCommand", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
ParameterExpression instance = Expression.Parameter(typeof(Editor), "ed");
ParameterExpression args = Expression.Parameter(typeof(object[]), "args");
return Expression.Lambda<Func<Editor, object[], PromptStatus>>(
Expression.Call(instance, method, args), instance, args)
.Compile();
}
Par contre pour la "CommanAsync", si quelqu'un sait la refaire. Je suis preneur !!!
@+
S
Latest posts made by SoBuild
-
Editor.Command(...), Editor.CommanAsync(...) n'existent pas en ZWCAD