public DealershipEngine(IDealershipFactory factory, IInputOutputProvider ioProvider) { this.factory = factory; this.ioProvider = ioProvider; this.users = new List <IUser>(); this.loggedUser = null; }
public DealershipEngine(IDealershipFactory factory, IInputOutputProvider ioProvider, ICommandHandler commandHandler) { if (factory == null) { throw new ArgumentNullException(nameof(factory)); } this.factory = factory; if (ioProvider == null) { throw new ArgumentNullException(nameof(ioProvider)); } this.ioProvider = ioProvider; if (commandHandler == null) { throw new ArgumentNullException(nameof(commandHandler)); } this.commandHandler = commandHandler; this.users = new HashSet <IUser>(); this.loggedUser = null; }
public override void Load() { // Following code fragment automatically binds interfaces to classes: //Kernel.Bind(x => //{ // x.FromAssembliesInPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) // .SelectAllClasses() // .BindDefaultInterface(); //}); // Instead of: // Bind<IAutomobile>().To<Automobile>(); // Bind<IAutomobileFactory>().ToFactory().InSingletonScope(); // etc. // Easy way to create factory. No class created, only interface. Bind <IAutomobile>().To <Automobile>(); Bind <IAutomobileFactory>().ToFactory().InSingletonScope(); // Inject dependency IInputOutputProvider into IWheaterDataProvider Bind <IWeatherDataProvider>().To <WeatherDataProvider>(); Bind <IInputOutputProvider>().To <InputOutputProvider>(); Bind <IInputOutputProvider>().ToMethod(context => { IInputOutputProvider inputOutputProvider = context.Kernel.Get <IInputOutputProvider>(); // Instead of NEW keyword return(inputOutputProvider); }).WhenInjectedInto <IWeatherDataProvider>(); }
public DealershipEngine( ICommand startCommand, IDealershipFactory dealershipFactory, IInputOutputProvider inputOutputProvider) { this.startCommand = startCommand; this.dealershipFactory = dealershipFactory; this.inputOutputProvider = inputOutputProvider; }
public GameManager(IInputOutputProvider inputOutputProvider, ISettingsProvider settingsProvider, IFigureProvider figureProvider, IBoard board) { this.inputOutputProvider = inputOutputProvider; this.settingsProvider = settingsProvider; this.figureProvider = figureProvider; this.board = board; settings = settingsProvider.GetSettings(); board.SetBoardSize(settings.BoardWidth, settings.BoardHeight); }
public GameManager(IPhraseProvider phraseProvider, IInputOutputProvider inputOutputProvider, INumberGenerator numberGenerator, ISettingsProvider settingsProvider) { this.phraseProvider = phraseProvider; this.inputOutputProvider = inputOutputProvider; this.numberGenerator = numberGenerator; this.settingsProvider = settingsProvider; _settings = settingsProvider.GetSettings(); phraseProvider.SetLanguage(_settings.LanguageFile); isRestarting = false; }
public void PrintReports(IInputOutputProvider inputOutputProvider) { var output = new StringBuilder(); foreach (var report in this.reports) { output.AppendLine(report); output.AppendLine(new string('#', 20)); } inputOutputProvider.Write(output.ToString()); }
public DealershipEngine(ICommandHandler commandHandler, ICommandFactory commandFactory, IInputOutputProvider inputOutputProvider, IReportsProvider reportsProvider) { Guard.WhenArgument(commandHandler, "commandHandler").IsNull().Throw(); Guard.WhenArgument(inputOutputProvider, "inputOutputProvider").IsNull().Throw(); Guard.WhenArgument(commandFactory, "commandFactory").IsNull().Throw(); Guard.WhenArgument(reportsProvider, "reportsProvider").IsNull().Throw(); this.commandHandler = commandHandler; this.inputOutputProvider = inputOutputProvider; this.commandFactory = commandFactory; this.reportsProvider = reportsProvider; }
public DealershipEngine( IInputOutputProvider provider, ICommentFactory commentFactory, ICommandFactory commandFactory, IUserFactory userFactory, IVehicleFactory vehicleFactory) { this.provider = provider; this.commentFactory = commentFactory; this.commandFactory = commandFactory; this.userFactory = userFactory; this.vehicleFactory = vehicleFactory; this.users = new Collection <IUser>(); this.loggedUser = null; }
public DealershipEngine( IInputOutputProvider provider, ICommentFactory commentFactory, ICommandFactory commandFactory, IUserFactory userFactory, IVehicleFactory vehicleFactory) { this.provider = provider; this.commentFactory = commentFactory; this.commandFactory = commandFactory; this.userFactory = userFactory; this.vehicleFactory = vehicleFactory; this.users = new Collection<IUser>(); this.loggedUser = null; }
public WeatherDataProvider(IInputOutputProvider inputOutputProvider) { this.inputOutputProvider = inputOutputProvider; }
public Engine(StudentData studentData, IInputOutputProvider inputOutputProvider) { this.studentData = studentData; this.inputOutputProvider = inputOutputProvider; }
public Engine(StudentSystem students, IInputOutputProvider inputOutputProvider) { this.studentSystem = students; this.inputOutputProvider = inputOutputProvider; }
public WebServer(IInputOutputProvider inputOutputProvider, IResponseProvider responseProvider) { this.inputOutputProvider = inputOutputProvider; this.responseProvider = responseProvider; }
/// <summary> /// Constructor with which you can supply a single input/output source /// </summary> /// <param name="inputOutput">The input/output provider</param> public Interpreter(IInputOutputProvider inputOutput, String program = "") : this(inputOutput, inputOutput, program) { }
public DealershipEngine(IDealershipFactory dealershipFactory, ICommandHandlerProcessor commandHandler, IInputOutputProvider inputOutputProvider) { this.dealershipFactory = dealershipFactory; this.commandHandler = commandHandler; this.inputOutputProvider = inputOutputProvider; }