コード例 #1
0
 public CreateFinalResultCommand(IResultFactory resultFactory, IAddResult addResult, IGetMatchById getMatch, IBetController betController)
 {
     this.getMatch      = getMatch;
     this.betController = betController;
     this.resultFactory = resultFactory;
     this.addResult     = addResult;
 }
コード例 #2
0
        public BettingManagerEngine(IReader readerProvider, IWriter writerProvider, IParser parserProvider)
        {
            this.accounts = new Dictionary <string, IAccount>();
            this.lines    = new Dictionary <string, IBetLine>();
            this.matches  = new Dictionary <int, IMatch>();

            this.betController     = new BetController();
            this.betLineController = new BetLineController();
            this.matchController   = new MatchController();
            this.resultController  = new ResultController();

            if (readerProvider == null)
            {
                throw new ArgumentNullException($"Reader {NullProvidersExceptionMessage}");
            }

            if (writerProvider == null)
            {
                throw new ArgumentNullException($"Writer {NullProvidersExceptionMessage}");
            }

            if (parserProvider == null)
            {
                throw new ArgumentNullException($"Parser {NullProvidersExceptionMessage}");
            }

            this.reader = readerProvider;
            this.writer = writerProvider;
            this.parser = parserProvider;
        }
コード例 #3
0
        public CloseCommandHandler(
            IPortfolioDataProvider portfolioDataProvider,
            IBetController betController)
        {
            Condition.Requires(portfolioDataProvider).IsNotNull();
            Condition.Requires(betController).IsNotNull();

            this._portfolioDataProvider = portfolioDataProvider;
            this._betController         = betController;
        }
コード例 #4
0
        public ClientMainWindow(ControllerFactory controllerFactory, ILogger logger)
            : base(logger)
        {
            InitializeComponent();

            accountController = controllerFactory.CreateAccountController();
            betController     = controllerFactory.CreateBetController();

            accountController.ReceivedMessage += (s, e) => UpdateLogs(e.Success, e.Message);
            betController.ReceivedMessage     += (s, e) => UpdateLogs(e.Success, e.Message);

            UpdateLogs(true, "Welcome, client");
        }
コード例 #5
0
        public BetCommandHandler(
            IPortfolioDataProvider portfolioDataProvider,
            IAccountDataProvider accountDataProvider,
            IStockDataProvider stockDataProvider,
            IBetController betController)
        {
            Condition.Requires(portfolioDataProvider).IsNotNull();
            Condition.Requires(accountDataProvider).IsNotNull();
            Condition.Requires(stockDataProvider).IsNotNull();
            Condition.Requires(betController).IsNotNull();

            this._accountDataProvider   = accountDataProvider;
            this._portfolioDataProvider = portfolioDataProvider;
            this._stockDataProvider     = stockDataProvider;
            this._betController         = betController;
        }