static void Main(string[] args) { var tester = new Tester(); var ioManager = new IOManager(); var repo = new StudentsRepository(new Sorter(), new Filter()); var commandInterpreter = new CommandInterpreter(tester, repo, ioManager); var reader = new InputReader(commandInterpreter); reader.StartReadingCommands(); }
public static void Main() { Tester tester = new Tester(); IOManager ioManager = new IOManager(); StudentsRepository repo = new StudentsRepository(new RepositoryFilter(), new RepositorySorter()); CommandInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); InputReader reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); }
public static void Main() { IContentComparer tester = new Tester(); IDirectoryManager ioManager = new IOManager(); IDatabase repo = new StudentsRepository(new RepositorySorter(), new RepositoryFilter()); IInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); IReader reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); }
static void Main(string[] args) { Tester tester = new Tester(); IOManager ioManager = new IOManager(); StudentsRepository repo = new StudentsRepository(new RepositoryFilter(), new RepositorySorter()); CommandInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); InputReader reader = new InputReader(currentInterpreter); OutputWriter.WriteMessageOnNewLine("Please enter a coomand OR type 'help' in order to get the full list of commands which are available."); reader.StartReadingCommands(); }
public static void Main() { IContentComparer tester = new Tester(); IDirectoryManager manager = new IOManager(); IDataFilter filter = new RepositoryFilter(); IDataSorter sorter = new RepositorySorter(); IDatabase repository = new StudentRepository(filter, sorter); IInterpreter interpreter = new CommandInterpreter(tester, repository, manager); IReader reader = new InputReader(interpreter); reader.StartReadingCommands(); }
public static void StartReadingCommands() { OutputWriter.WriteMessage($"{SessionData.currentPath}" + "> "); string input = Console.ReadLine().Trim(); while (input != endCommand) { CommandInterpreter.InterpredCommand(input); OutputWriter.WriteMessage($"{SessionData.currentPath}" + "> "); input = Console.ReadLine().Trim(); } }
/// <summary> /// Entry point of program. /// </summary> /// <param studentByName="args">Arguments.</param> public static void Main(string[] args) { IContentComparer tester = new Tester(); IDirectoryManager manager = new IoManager(); IDatabase studentsRepository = new StudentsRepository(new RepositoryFilter(), new RepositorySorter()); ICommandInterpreter currentInterpreter = new CommandInterpreter(tester, studentsRepository, manager); var reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); }
public static void StartReadingCommands() { while (true) { OutputWriter.WriteMessage($"{SessionsData.currentPath}> "); string input = Console.ReadLine(); input = input.Trim(); if (input == endCommand) { break; } CommandInterpreter.InterpredCommand(input); } }
public static void Main() { Console.WriteLine(@"Please, enter ""help"" to recieve information about the commands available. ALL COMMANDS are lowercase only! See for examples in ""help"" section."); Console.WriteLine(); IContentComparer tester = new Tester(); IDirectoryManager ioManager = new IOManager(); IDatabase repo = new StudentsRepository(new RepositorySorter(), new RepositoryFilter()); IInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); IReader reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); }
/// <summary> /// Starts to listen for commands and executes them if the syntax is correct. /// </summary> public static void StartReadingCommands() { OutputWriter.WriteMessage($"{SessionData.currentPath}> "); string input = Console.ReadLine(); input = input.Trim(); // TODO: change with do-while ??? avoiding repetitions of code while (!input.Equals(endCommand)) { CommandInterpreter.InterpredComman(input); OutputWriter.WriteMessage($"{SessionData.currentPath}> "); input = Console.ReadLine(); input = input.Trim(); } }
public static void StartReadingCommands() { bool closeConsole = false; while (!closeConsole) { OutputWriter.WriteMessage($"{SessionData.currentPath}>"); string input = Console.ReadLine(); input = input.Trim(); if (input.Equals(endCommand)) { closeConsole = true; continue; } CommandInterpreter.InterpredCommand(input); } }
public static void StartReadingCommands() { OutputWriter.WriteMessage($"{SessionData.CurrentPath}>"); string input; while ((input = Console.ReadLine()) != EndCommand) { if (string.IsNullOrWhiteSpace(input)) { continue; } input = input.Trim(); CommandInterpreter.InterpredCommand(input); OutputWriter.WriteMessage($"{SessionData.CurrentPath}>"); } }
public static void StartReadingCommands() { while (true) { OutputWriter.WriteMessage($"{SessionData.currentPath}> "); string input = Console.ReadLine().Trim(); if (input.Equals(endCommand)) { break; } if (string.IsNullOrEmpty(input)) { input = Console.ReadLine().Trim(); continue; } CommandInterpreter.InterpredCommand(input); } }
public static void StartReadingCommands() { OutputWriter.WriteMessage(SessionData.currentPath + "> "); string input = Console.ReadLine(); input = input.Trim(); CommandInterpreter.InterpredCommand(input); while (input != EndCommand) { if (input == EndCommand) { break; } OutputWriter.WriteMessage(SessionData.currentPath + "> "); input = Console.ReadLine(); input = input.Trim(); CommandInterpreter.InterpredCommand(input); } }
public static void StartReadingCommands() { OutputWriter.WriteMessage($"{SessionData.currentPath}> "); string input = Console.ReadLine(); input = input.Trim(); bool isInputQuit = false; while (!isInputQuit) { if (input == endCommand) { isInputQuit = true; break; } CommandInterpreter.InterpredCommand(input); OutputWriter.WriteMessage($"{SessionData.currentPath}> "); input = Console.ReadLine(); input = input.Trim(); } }
public static void Main() { #region comments // These comments below are some tests that I used to use from C# Advanced course /* P1 Tests * IOManager.TraverseDirectory(@"D:\Downloads"); * * P2 Tests * StudentsRepository.InitializeData(); * StudentsRepository.GetAllStudentsByCourse("Unity"); * StudentsRepository.GetStudentMarkInCourse("Unity", "Ivan"); * * P3 Tests * Tester.CompareContent(@".\BashSoft-Resources\test1.txt", @".\BashSoft-Resources\test2.txt"); * Tester.CompareContent(@".\BashSoft-Resources\test1.txt", @".\BashSoft-Resources\test3.txt"); * * P4 Tests * IOManager.CreateDirectoryInCurrentFolder("Pesho"); * IOManager.TraverseDirectory(5); * IOManager.CreateDirectoryInCurrentFolder("Pesho"); * IOManager.ChangeCurrentDirectoryRelative("Pesho"); * IOManager.ChangeCurrentDirectoryAbsolute("Pesho"); * IOManager.ChangeCurrentDirectoryAbsolute(@"C:\Windows"); * IOManager.TraverseDirectory(20); * Tester.CompareContent("actual", "expecter"); * IOManager.CreateDirectoryInCurrentFolder("*2"); * * InputReader.StartReadingCommands(); */ #endregion IContentComparer tester = new Tester(); IDirectoryManager ioManager = new IOManager(); IDatabase repo = new StudentsRepository(new RepositoryFilters(), new RepositorySorters()); IInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); IReader reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); }
public static void Main() { //IOManager.TraverseDirectory(10); //StudentsRepository.InitializeData(); //StudentsRepository.GetAllStudentFromCourse("Unity"); //StudentsRepository.GetStudentScoresFromCourse("Unity", "Ivan"); //Tester.CompareContent(@"C:\Users\vradoyko\Desktop\user\test2.txt", @"C:\Users\vradoyko\Desktop\user\test3.txt"); //IOManager.CreateDirectoryInCurrentFolder("vasko"); //IOManager.ChangeCurrentDirectoryAbsolute(@"C:\windows"); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.TraverseDirectory(50); IContentComparer tester = new Tester(); IDirectoryManager ioManager = new IOManager(); IDatabase repo = new StudentsRepository(new RepositoryFilter(), new RepositorySorter()); IInterpreter cmdInterpreter = new CommandInterpreter(tester, repo, ioManager); IReader reader = new InputReader(cmdInterpreter); reader.StartReadingCommands(); }
public InputReader(CommandInterpreter interpreter) { this.interpreter = interpreter; }
public static void Main(string[] args) { #region AdvancedTests /// ///Testing Traversing A Folder ///Works /// //IOManager.TraverseDirectory(); /// ///Testing Get All Students ///Works kinda /// //StudentsRepository.InitializeData(); //StudentsRepository.GetAllStudentsFromCourse("Unity"); //StudentsRepository.GetStudentScoresFromCourse("Unity", "Ivan"); /// ///Testing Comparing Files ///Works /// //Tester.CompareContent(@"E:\Projects\BashSoft\BashSoft\BashSoft\resources\test2.txt" // , @"E:\Projects\BashSoft\BashSoft\BashSoft\resources\test3.txt"); // cmp E:\Projects\BashSoft\BashSoft\BashSoft\resources\test1.txt E:\Projects\BashSoft\BashSoft\BashSoft\resources\test2.txt /// ///Testing Creating Folders And Traversing Folders ///Works /// //IOManager.CreateDirectoryInCurrentFolder("*2"); //IOManager.ChangeCurrentDirectoryAbsolute(@"C:\Windows"); //IOManager.TraverseDirectory(20); /// ///Testing Going one folder up the hierarchy ///Works /// //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); //IOManager.ChangeCurrentDirectoryRelative(".."); /// ///Testing InputReader and CommandInterpreter ///Works /// #endregion IContentComparer tester = new Tester(); IDirectoryManager ioManager = new IOManager(); IDatabase repo = new StudentsRepository(new RepositoryFilter(), new RepositorySorter()); IInterpreter currentInterpreter = new CommandInterpreter(tester, repo, ioManager); IReader reader = new InputReader(currentInterpreter); reader.StartReadingCommands(); /// ///Tips ///use cdrel resources ///then read files from there with readdb ///or help to see other commands /// }