code_junkie

Declare a Dictionary inside a static class

Nov 12th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. public static class ErrorCode
  2. {
  3. public const IDictionary<string , string > ErrorCodeDic
  4. =new Dictionary<string, string>()
  5. {
  6. {"1","User name or password problem"}
  7. };
  8. }
  9.  
  10. private static readonly Dictionary<string, string> ErrorCodes
  11. = new Dictionary<string, string>
  12. {
  13. { "1", "Error One" },
  14. { "2", "Error Two" }
  15. };
  16.  
  17. public static class ErrorCode
  18. {
  19. public static IDictionary<string, string> ErrorCodeDic;
  20. static ErrorCode()
  21. {
  22. ErrorCodeDic = new Dictionary<string, string>()
  23. { {"1", "User name or password problem"} };
  24. }
  25. }
  26.  
  27. public static class ErrorCode
  28. {
  29. public static IDictionary<string, string> ErrorCodeDic
  30. = new Dictionary<string, string>()
  31. { {"1", "User name or password problem"} };
  32. }
  33.  
  34. private static readonly StringDictionary SegmentSyntaxErrorCodes = new StringDictionary
  35. {
  36. { "1", "Unrecognized segment ID" },
  37. { "2", "Unexpected segment" }
  38. };
  39.  
  40. public static class ErrorCode
  41. {
  42. public const IDictionary<string, string> ErrorCodeDic;
  43. public static ErrorCode()
  44. {
  45. ErrorCodeDic = new Dictionary<string, string>()
  46. { {"1", "User name or password problem"} };
  47. }
  48. }
  49.  
  50. public static class ErrorCode
  51. {
  52. public const IDictionary<string , string > m_ErrorCodeDic;
  53.  
  54. public static ErrorCode()
  55. {
  56. m_ErrorCodeDic = new Dictionary<string, string>()
  57. { {"1","User name or password problem"} };
  58. }
  59. }
Add Comment
Please, Sign In to add comment