Create a class that has all public const string members.
Code:
public class SharedStrings
{
public const string Triangle = "A triangle has three sides";
public const string Octagon = "An octagon has eight sides";
// and so on
}
But honestly, this is the sort of thing that embedded resources were made for. Plus, they can be localized to different cultures pretty easily. Doing it this way means you can only support one culture, and adding a new culture means you have to make serious code changes, versus just creating a new resource assembly for that culture and dropping it in the correct directory.
Chip H.
____________________________________________________________________
Donate to Katrina relief:
Generally, you would add a resource to your assembly (File | Add New...), then write code to use the ResourceManager class to retrieve your strings, icons, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.