Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: solenn on September 19, 2011, 06:21:27 pm
-
Hello,
I would like to change package apparence in project brower with code.
I would like to put an specific image.
Can someone help me?
Thanks a lot,
Solenn
-
Depends. The help is that this does not work. You can not change the browser icons.
q.
-
q is correct:
You can not change the browser icons.
...for packages. You CAN change the browser icons for other elements.
-
Ooops. That has passed my attention.
q.
-
Weel, you are supposed to be able to do it, as far as I know, using an MDG Add-in, when the MDG Add-In "connects" to a package.
I have never got this to work, despite numerous attempts, however I have seen it work in Add-Ins supplied by Sparx for example the VS integration and the DOORS import. Where the connected package as an "indicator" icon attached. (Similar to the namespace root, and version control indicators)
I would really like to know how this is achieved in an add-in, I am afraid the usert guide isn't much help as the example quoted is for VB and in now way will work for C#
MDG_GetProperty provides miscellaneous Add-In details to
Enterprise Architect. This function is called byEnterprise Architect
to poll the Add-In for information relating to the PropertyName.
This event should occur in as short a duration as possible as
Enterprise Architect does not cache the information provided by
the function.
Values corresponding to the following PropertyNames must be
provided:
IconID - Return the name of a DLL and a resource
identifier in the format #ResID, where the resource ID
indicates an Icon; for example,
c:\program files\myapp\myapp.dlll#101
Language - Return the default language that Classes
should be assigned when they are created in Enterprise
Architect
HiddenMenus - Return one or more values from the
MDGMenus enumeration to hide menus that do not apply
to your Add-In. For example:
i f ( Pr o p e r t y Name == " Hi d d e nMe n u s " )
r e t u r n mg Bu i l d Pr o j e c t + mgRu n ;
How do you get the resource icon id (any number I choose just gives me the namespace root indictaor - I do have an icon as a resource in my project, but it has a name and not a number) and as far as I know you cannot add enumerations in C#, so the second line of code won't work
Any advice?
Cheers
Phil