public ActionResult InsertWord(TextStorageModel model) { IModeHandler service = new ModeHandler(new WordService(new FileWrapper()), new Validator(), new WordInverter()); UserMode mode = UserMode.INSERT; var path = Path.Combine(Environment.CurrentDirectory, "SavedWords.txt"); service.OrchestrateMode(mode, model.WordToStore); return View("Index"); }
static void Main(string[] args) { IModeHandler service = new ModeHandler(new WordService(new FileWrapper()), new Validator(), new WordInverter()); UserMode mode = GetMode(); if (mode == UserMode.INSERT) { service.OrchestrateMode(mode, GetWord()); } else { service.OrchestrateMode(mode, ""); } }