Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class SharedStrings
- {
- private static Dictionary<int, string> myStrings;
- static SharedStrings()
- {
- myStrings = new Dictionary<int, string>();
- myStrings.Add(42, "hello");
- }
- public static string GetStringFromIndex(int index)
- {
- lock (typeof(SharedStrings))
- {
- return myStrings[index];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement