Microsoft 开发人员网络 > 论坛主页 > Visual C# General > Extend file based resource manager
提出问题提出问题
 

问题Extend file based resource manager

  • 2009年11月4日 14:39spalladino 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    I want to store my resources in a different file format than NET's  .resources (in particular, .po), so I wrote a custom resource set with a custom resource reader to retrieve them. I created a ResourceManager using the CreateFileBasedResourceManager static method which creates a new instance of the manager that retrieves resource sets from files in a specific dir, using the specified resource set (the custom one I wrote in my case), using Name.culture.resources filenames.

    However, I would like to change the filename convention. I noticed there is an overridable GetResourceFileName method for precisely that purpose. But using reflector I noticed that the constructor used by CreateFileBasedResourceManager is private, and it is impossible to set the "use files instead of assemblies" flag otherwise.

    Is there any way to go around this, without needing to reimplement the whole InternalGetResourceSet method?

    Thanks a lot!