Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Slávek Rydval on November 01, 2016, 08:18:25 am

Title: MDG_GetProperty and icon
Post by: Slávek Rydval on November 01, 2016, 08:18:25 am
Hi,

are there any rules related to the icon in dll with the plugin? I've got MDG plugin written in C# (.NET 4.5.2 or higher) and an icon as a resource. When a question to the icon comes I return:


public object MDG_GetProperty(EA.Repository Repository, string PackageGuid, string PropertyName)
{
    switch (PropertyName)
    {
        case "IconID": return System.Reflection.Assembly.GetExecutingAssembly().Location + "#treeview";
        case "Language": return null;
        case "HiddenMenus": return EA.MDGMenus.mgBuildProject & EA.MDGMenus.mgMerge & EA.MDGMenus.mgRun;
        default: return null;
    }
}


Although the package is connected, no icon is shown. Beside the icon I tried also a bitmap without any positive effect. Can you give me any hint? Cheers.
Title: Re: MDG_GetProperty and icon
Post by: Slávek Rydval on November 06, 2016, 01:37:55 am
No reply so far, so I prepared minimal solution, maybe someone will try it: https://github.com/SlavekRydval/SparxEAMDGMinimal (https://github.com/SlavekRydval/SparxEAMDGMinimal)
Title: Re: MDG_GetProperty and icon
Post by: Slávek Rydval on November 06, 2016, 03:51:26 am
Ok, I got it. It seems that the DLL with the icon musn't be a .NET DLL. If I build Win32 DLL, it is working.

[modification]
As for the hidden menu items, it must be obviously return EA.MDGMenus.mgBuildProject | EA.MDGMenus.mgMerge | EA.MDGMenus.mgRun