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(); }
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(); }
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); }
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(); }