Book a Demo

Author Topic: Debugging Add-Ins or custom model validation code  (Read 5848 times)

pH

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Debugging Add-Ins or custom model validation code
« 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
<a href="http://webuml.org"><img src="http://webuml.org/images/webuml-badge.png" alt="Set UML Free!" style="border-width:0"></a>

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Debugging Add-Ins or custom model validation c
« Reply #1 on: February 22, 2011, 09:42:22 pm »
Use repository.writeoutput

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Debugging Add-Ins or custom model validation c
« Reply #2 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
« Last Edit: February 22, 2011, 10:54:21 pm by Geert.Bellekens »

eaeio

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Debugging Add-Ins or custom model validation c
« Reply #3 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) {}

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Debugging Add-Ins or custom model validation c
« Reply #4 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

pH

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: Debugging Add-Ins or custom model validation c
« Reply #5 on: February 25, 2011, 04:13:57 pm »
Thanks qwerty & Geert. It was indeed helpful

-pH
<a href="http://webuml.org"><img src="http://webuml.org/images/webuml-badge.png" alt="Set UML Free!" style="border-width:0"></a>