/// <summary> /// Initializes all dependencies for CommandParser and options in OptionSet /// </summary> public CommandParser() { userValidator = NinjectKernel.Get <UserValidationService>(); printer = NinjectKernel.Get <IInputOutputSevice>(); InitializeOptionSet(); }
private static void Main() { using (var work = new UnitOfWork()) { var res = work.Cities; } var iOService = NinjectKernel.Get <IInputOutputSevice>(); // Run Bot1 var botRunner = new BotRunner(); botRunner.Run(); iOService.Out.WriteLine(Resources.InfoGreeting); Logger.Info(Resources.InfoGreeting); Command authenHandlers = GetAuthenticationCommand(); Command loggedInHandlers = GetLoggedInCommand(); var exitCommand = false; exitMethod = (sender, e) => { exitCommand = true; }; while (!exitCommand) { while (!CommandHandler.Session.IsLogged) { iOService.Out.WriteLine(Resources.InfoFirsUsage); iOService.Out.Write(Resources.InfoNewCommandLine); authenHandlers.Execute(iOService.In.ReadLine()); iOService.Out.WriteLine(); } iOService.Out.Write(Resources.InfoNewCommandLine); loggedInHandlers.Execute(iOService.In.ReadLine()); iOService.Out.WriteLine(); } }
/// <summary> /// Creates and initializes Command with appropriate objects /// </summary> public Command() { Handlers = new Dictionary <string, ICommandHandler>(); ioService = NinjectKernel.Get <IInputOutputSevice>(); Parser = NinjectKernel.Get <CommandParser>(); }