Here is my code right now. But I would like to move these "Add" from the constructor. Can we initialize the Dictionary when we new this? or you have another idea. Basically I want to define a few characters that are used in many places.
public class User { public enum actionEnum { In, Out, Fail } public static Dictionary<actionEnum, String> loginAction = new Dictionary<actionEnum, string>(); public User() { loginAction.Add(actionEnum.In, "I"); loginAction.Add(actionEnum.Out, "O"); loginAction.Add(actionEnum.Fail, "F"); } ..... }
source share