Select to view content in your preferred language

Tool Icon does not load

1294
2
06-12-2013 10:22 AM
Swani_Jesus_Captonsiluvairajan
Occasional Contributor
If I add an Icon to my Tool using the 'DefaultIconAttribute' on the tool class, the icon doesn't load 😞

Here is the code snippet that goes on top of the Tool

    [Export(typeof(ICommand))]
    [DisplayName("Login")]
    [Category("ESIS 2013")]
    [Description("Login into ESIS 2013")]
    [DefaultIcon("/ESIS2013.AddIns;component/Images/ESIS2012_16.png")]
    public class LoginTool : ICommand, ISupportsConfiguration
    {}

The icon is 16x16 pixels png and is inside the folder 'Images' inside my  ESIS2013.AddIns assembly.  I have set the build method to 'resource" - Do not Copy

But if I add it to the Tools.xml config file, it works
here is the code


      <Tool Label="Login"
            Icon="/ESIS2013.AddIns;component/Images/ESIS2012_16.png"
            Description="Login into ESIS 2013">
        <Tool.Class>
          <ESIS2013Users:LoginTool />
        </Tool.Class>
        <Tool.ConfigData>xx</Tool.ConfigData>
      </Tool>

Wonder why this happens.  What am I doing wrong?
0 Kudos
2 Replies
Swani_Jesus_Captonsiluvairajan
Occasional Contributor
Hi,

If it does not work when you are developing (running with the visual studio) then its ok, you have to modified the Tools.xml by yourself to set up the addIn.
If it does not work when you load the addIn to an app in the builder then that's a problem. Its this your case?.

Hope it helps.
Regards, Manuel


No.  It doesn't work in Visual Studio.  What is that OK?  Why can't I have the default icon specified in the class instead of the Tools.xml config file?
0 Kudos
Swani_Jesus_Captonsiluvairajan
Occasional Contributor
From what I understand, the application load the information from the config files like the Tools.xml. Now when you are working with the viewer this process alter the configuration files every time you save an application, for example the Tools.xml when you change the icon image of the tool or some other information. When you are developing there is no process that do that, the image icon (even it goes with the tool) in the developing ambient is like the config data from the tool you have to work it yourself. I hope i am not in a mistake.

Hope it help.
Regards, Manuel


Yeah,  I understand how it works when using the viewer manager to configure applications.  I am not interested in that.  I only want to know why the icon cannot be loaded as attribute value in the class definition. But anyways thanks for trying to help.
0 Kudos