I\'m building a C# app that will likely contain a couple resource files to store strings for use in language translation. I\'m trying to come up with a naming convention for
If you have a Name Value Pair in resources like
CloseConfirmation - Do you want to close the window without saving ?
Add a new class called Messages.
public static class Messages
{
public const String CloseConfirmation = "CloseConfirmation";
public static String GetMessage( String messageId )
{
return //your namespace//.Properties.Resources.ResourceManager.GetString( messageId );
}}
and to access it use
MessageBox.Show( Messages.GetMessage(Messages.CloseConfirmation));
Hope this will help.