static void Main(string[] args) { IUserIO io = new UserIO(); ICharacterRepository repo = new FileCharacterRepository("Characters.txt"); CharacterManager manager = new CharacterManager(io, repo); manager.Run(); }
public static ICharacterRepository GetNewCharacterRepository() { ICharacterRepository repo = null; string setting = ConfigurationManager.AppSettings["someSetting"]; switch (setting) { case "bob": repo = new FileCharacterRepository("Characters.txt"); break; case "list": repo = new ListCharacterRepository(); break; default: repo = new ListCharacterRepository(); break; } return repo; }