Exemple #1
0
        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");

            
        }
Exemple #2
0
        public ActionResult Index()
        {
            TextStorageModel model = new TextStorageModel();

            var path = Path.Combine(Environment.CurrentDirectory, "SavedWords.txt");
            
            IWordService handler = new WordService(new FileWrapper());
            List<string> storedWords = handler.RetrieveAllWords(path);
            model.StoredWords = string.Join("\r\n", storedWords);

            //string test = test234.MakeRelativePath(@"C:\Users\mfinn\Desktop\ReverseStorage\ReverseStorage\Business", @"C:\Users\mfinn\Desktop\ReverseStorage\ReverseStorage\SavedWords.txt");

            return View(model);
        }