Book a Demo

Author Topic: C# signature for Addin.EA_OnStartValidation()  (Read 4049 times)

Manfred Kröpfli

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
C# signature for Addin.EA_OnStartValidation()
« on: March 31, 2009, 08:55:04 am »
Hi
 
I want to use the Addin trigger method EA_OnStartValidation() as described in the EA User Guide, but I need the C# version of it. I tried:

Code: [Select]
C#:
public void EA_OnStartValidation(EA.Repository Repository, params object[] Args)

as a replacement for the documented VBA signature:

Code: [Select]
VBA:
Sub EA_OnStartValidation(Repository As EA.Repository, ParamArray Args() as Variant)

but without success. I get the error message: "EA_OnStartValidation(): invalid parameter(s)". How does the correct C# method signature look like?

Thanks
Manfred
« Last Edit: March 31, 2009, 08:55:45 am by kroepfli »
Cheers
Manfred

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: C# signature for Addin.EA_OnStartValidation()
« Reply #1 on: March 31, 2009, 11:03:46 pm »
Hi Manfred,

You might try simply
Code: [Select]
object Args instread of,
Code: [Select]
params object[] Argsand try to cast Args to the object array internally. Don't know if this will work, just an Idea ...

HTH
Günther

Manfred Kröpfli

  • EA User
  • **
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: C# signature for Addin.EA_OnStartValidation()
« Reply #2 on: April 01, 2009, 07:40:19 pm »
Günther

you intuition was good. Following C# code works fine:

Code: [Select]
public void EA_OnStartValidation(EA.Repository repository, object  argsObject) {
    string[] args = (string[])argsObject;
    ...
}

Beste Grüsse
Manfred
Cheers
Manfred