private StudioEntityRegistry(IStorage storage) : base(storage) { Prepare(); var delayAction = new DelayAction(storage, exception => exception.LogError()); Sessions = new SessionList(Storage) { DelayAction = delayAction }; _boards = new ExchangeBoardListEx(Storage); _securities = new StudioSecurityList(this) { DelayAction = delayAction }; _portfolios = new PortfolioList(Storage) { BulkLoad = true, DelayAction = delayAction }; //FavoriteSecurities = new FavoriteSecurityList(this) { BulkLoad = true, DelayAction = delayAction }; IndexSecurities = new IndexSecurityList(storage) { BulkLoad = true, DelayAction = delayAction }; ContinuousSecurities = new ContinuousSecurityList(this) { DelayAction = delayAction }; var session = Sessions.Battle; if (session == null) { session = new Session { Type = SessionType.Battle, StartTime = DateTime.Today, EndTime = DateTime.MaxValue, Settings = new SettingsStorage(), }; Sessions.Add(session); Sessions.DelayAction.WaitFlush(); } DelayAction = delayAction; CreateCommonData(); Strategies = new StrategyInfoList(this, session); }
/// <summary> /// Initializes a new instance of the <see cref="NativeIdSecurityStorage{T}"/>. /// </summary> /// <param name="storageSecurityList">The storage of securities.</param> /// <param name="comparer"><typeparamref name="TNativeId"/> comparer.</param> protected NativeIdSecurityStorage(IStorageSecurityList storageSecurityList, IEqualityComparer <TNativeId> comparer) { if (storageSecurityList == null) { throw new ArgumentNullException(nameof(storageSecurityList)); } _storageSecurityList = storageSecurityList; _cacheByNativeId = new SynchronizedDictionary <TNativeId, Security>(comparer); TryAddToCache(storageSecurityList); }
/// <summary> /// Получить инструмент "Все инструменты". /// </summary> /// <param name="securities">Инструменты.</param> /// <returns>Инструмент "Все инструменты".</returns> public static Security GetAllSecurity(this IStorageSecurityList securities) { return(securities.ReadById(AllSecurityId)); }