コード例 #1
0
ファイル: AccountsStorage.cs プロジェクト: qadmium/ibapi
        public AccountsStorage(List<IAccountInternal> accounts, ProxiesFactory proxiesFactory)
        {
            Contract.Requires(accounts != null);
            Contract.Requires(proxiesFactory != null);

            this.accounts = accounts.AsReadOnly();
            this.accountsProxies = this.accounts.Select(proxiesFactory.CreateAccountProxy).ToList().AsReadOnly();
        }
コード例 #2
0
ファイル: OrdersStorageProxy.cs プロジェクト: qadmium/ibapi
        public OrdersStorageProxy(IOrdersStorage ordersStorage, Dispatcher dispatcher, ProxiesFactory proxiesFactory)
        {
            Contract.Requires(ordersStorage != null);
            Contract.Requires(dispatcher != null);
            Contract.Requires(proxiesFactory != null);

            this.dispatcher = dispatcher;
            this.proxiesFactory = proxiesFactory;

            this.orderAddedEvent = this.dispatcher.RegisterEvent();
            ordersStorage.OrderAdded += this.OnOrderAdded;
            this.orders = ordersStorage.Orders.Select(proxiesFactory.CreateOrderProxy).ToList();
        }
コード例 #3
0
ファイル: ApiObjectsFactory.cs プロジェクト: qadmium/ibapi
        public ApiObjectsFactory(IConnection connection, IIdsDispenser idsDispenser, Dispatcher dispatcher,
            CancellationTokenSource internalCancellationTokenSource)
        {
            System.Diagnostics.Contracts.Contract.Requires(connection != null);
            System.Diagnostics.Contracts.Contract.Requires(idsDispenser != null);
            System.Diagnostics.Contracts.Contract.Requires(dispatcher != null);

            this.connection = connection;
            this.idsDispenser = idsDispenser;
            this.dispatcher = dispatcher;
            this.internalCancellationTokenSource = internalCancellationTokenSource;
            this.proxiesFactory = new ProxiesFactory(dispatcher);
        }
コード例 #4
0
        public PositionsStorageProxy(IPositionsStorage positionsStorage, Dispatcher dispatcher, ProxiesFactory proxiesFactory)
        {
            Contract.Requires(positionsStorage != null);
            Contract.Requires(dispatcher != null);
            Contract.Requires(proxiesFactory != null);

            this.dispatcher = dispatcher;
            this.proxiesFactory = proxiesFactory;

            this.positionAddedEvent = dispatcher.RegisterEvent();
            positionsStorage.PositionAdded += this.OnPositionAdded;
            this.positions = positionsStorage.Positions.Select(proxiesFactory.CreatePositionProxy).ToList();
        }