Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: pH on February 22, 2011, 09:07:01 pm

Title: Debugging Add-Ins or custom model validation code
Post by: pH on February 22, 2011, 09:07:01 pm
Greetings!!
Is there any efficient way to debug C# code written for add-ins or customized model validation add-ins? I mean simple print statements can help to identify whats going on in the code. Is there any way to do that?

Thanks,
pH
Title: Re: Debugging Add-Ins or custom model validation c
Post by: qwerty on February 22, 2011, 09:42:22 pm
Use repository.writeoutput

q.
Title: Re: Debugging Add-Ins or custom model validation c
Post by: Geert Bellekens on February 22, 2011, 10:28:03 pm
I've written an article about that a few weeks ago:
Community site article:http://community.sparxsystems.com/resources/scripts/c-add-test-application
Blog post: http://geertbellekens.wordpress.com/2011/02/08/testing-and-debugging-your-enterprise-architect-csharp-add-in/
Source Code: http://geertbellekens.github.com/Enterprise-Architect-Add-in-Framework/

If you don't have a full Visual Studio, SharpDevelop (open source) could be of help.

Geert
Title: Re: Debugging Add-Ins or custom model validation c
Post by: eaeio on February 23, 2011, 06:10:25 am
What is the variable IsChecked in ...

public void EA_GetMenuState(EA.Repository Repository, string Location, string MenuName, string ItemName, ref bool IsEnabled, ref bool IsChecked) {}
Title: Re: Debugging Add-Ins or custom model validation c
Post by: Geert Bellekens on February 23, 2011, 06:41:38 pm
Ah, that seems to be missing from my documentation.
According to the help file it indicates whether the option should be checked.
I haven't tried this yet, but I guess it will put a little "v" in front of the menu option.

I'll try it later and I'll post the results.

Geert
Title: Re: Debugging Add-Ins or custom model validation c
Post by: pH on February 25, 2011, 04:13:57 pm
Thanks qwerty & Geert. It was indeed helpful

-pH