ResourceManager

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Blair

    #1

    ResourceManager

    Hi,

    I am messing about using resource file.

    I have the following code:

    Assembly assembly = Assembly.GetExe cutingAssembly( );
    rm = new ResourceManager ("ResourceDemo. demo", assembly);
    txtBoxTitle.Tex t = rm.getString("T itle");

    This works no problem, but what i would like to do is make a resource
    editor, where any resource file can be loaded. the problem is the names of
    any of the resources wont be known. (The hardcoded "Title" for example.

    Is there a way of of getting the values from the resource file ?

    If I have a file with the following:

    UserName = "Steven"

    I want to load this value without having to do this:

    txtBoxTitle.Tex t = rm.getString("U serName");

    Hopefully something like, rm.GET_ITEM(i) or something like that.

    Hope that makes sense

    Steven
    A blog about computational biology, axolotls, and black cats.







  • Frank Eller [MVP]

    #2
    Re: ResourceManager

    Hi Steven,
    [color=blue]
    > I am messing about using resource file.
    >
    > I have the following code:
    >
    > Assembly assembly = Assembly.GetExe cutingAssembly( );
    > rm = new ResourceManager ("ResourceDemo. demo", assembly);
    > txtBoxTitle.Tex t = rm.getString("T itle");
    >
    > This works no problem, but what i would like to do is make a resource
    > editor, where any resource file can be loaded. the problem is the names of
    > any of the resources wont be known. (The hardcoded "Title" for example.
    >
    > Is there a way of of getting the values from the resource file ?
    >
    > If I have a file with the following:
    >
    > UserName = "Steven"
    >
    > I want to load this value without having to do this:
    >
    > txtBoxTitle.Tex t = rm.getString("U serName");
    >
    > Hopefully something like, rm.GET_ITEM(i) or something like that.
    >
    > Hope that makes sense[/color]

    Well, the resource-files (resx) are XML-Files, so you can easily read
    anything using XmlTextReader ...

    Regards,

    --
    Frank Eller [.NET MVP]
    another blog about programming with all things related to .NET

    ..NET Developers Group Munich- www.munichdot.net


    Comment

    Working...