Navigation

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. SoBuild
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Groups 1

    SoBuild

    @SoBuild

    Développeur

    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    SoBuild Unfollow Follow
    Développeur

    Latest posts made by SoBuild

    • Editor.Command(...), Editor.CommanAsync(...) n'existent pas en ZWCAD

      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 !!!

      @+

      posted in LISP VBA .NET et Applicatifs
      S
      SoBuild