none
Access resource and class library (C#) RRS feed

  • Question

  • Hi,

    I develop an application with MEF module and I would like to have different "Icone" for each module :

    My base class lib (Plugin) have a default image (a png file) that represent the plugin picture. All new module inherit from this base class. For a new module, if I change the "Icone" image by replacing the associated resource content, in all case, I always got the original image (the one form my base class lib).

    Here is the project tree : ISFTBase is the main module class. ISFPathSel is herited from ISFTBase. As you can see, they are both in the ressource path a resource name "Icone" that ref the "Icone.png" file. I would like to retrieve from the ISFPathSel module the Icone.png file inside, instead of the one in ISFTBase.

    If I get "Icone" from constructor (there is no specific constructor in ISFPathSel), I always get the "Icone" from ISFTBase using "Properties.Resources.Icone" in the constructor of ISFTBase. I also have a preInit fonction defined in ISFTBase which is call after loading and create plugin, but it's the same. I don't want to write specific code in each new plugin for just loading the right image plugin. Is there is a solution ?

    Thanks.

    Friday, October 19, 2012 9:11 AM

Answers

  • I think you can modify the resource's physical file path to let it work as you expected, otherwise, it seems that the two projects' Icone.png is pointing to the same physical file.

    You can edit the things from the project's .csproj file.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, October 22, 2012 6:26 AM
    Moderator

All replies

  • I think you can modify the resource's physical file path to let it work as you expected, otherwise, it seems that the two projects' Icone.png is pointing to the same physical file.

    You can edit the things from the project's .csproj file.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, October 22, 2012 6:26 AM
    Moderator
  • Hi Serge,

    How is it going with Mike's suggestion?

    Any update to this issue?

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, October 25, 2012 8:40 AM
    Moderator