Пример #1
0
        protected virtual RequestSymbolsResponseMessage Receive(RequestSymbolsMessage message)
        {
            RequestSymbolsResponseMessage response = new RequestSymbolsResponseMessage(true);

            DataSourceStub.IImplementation implementation = Implementation;
            if (implementation != null && OperationalState == OperationalStateEnum.Operational)
            {// Synchronous.
                response.SymbolsPeriods = implementation.SearchSymbols(message.SymbolMatch, message.ResultLimit);
            }
            else
            {
                response.OperationResult = false;
            }

            return(response);
        }
        protected virtual RequestSymbolsResponseMessage Receive(RequestSymbolsMessage message)
        {
            RequestSymbolsResponseMessage response = new RequestSymbolsResponseMessage(true);

            DataSourceStub.IImplementation implementation = Implementation;
            if (implementation != null && OperationalState == OperationalStateEnum.Operational)
            {// Synchronous.
                response.SymbolsPeriods = implementation.SearchSymbols(message.SymbolMatch, message.ResultLimit);
            }
            else
            {
                response.OperationResult = false;
            }

            return response;
        }
        protected RequestSymbolsResponseMessage Receive(RequestSymbolsMessage message)
        {
            RequestSymbolsResponseMessage response = new RequestSymbolsResponseMessage(true);
            foreach(Symbol symbol in _dataSessions.Keys)
            {
                if (_dataSessions[symbol].SessionInformation.Info.Symbol.MatchesSearchCriteria(message.SymbolMatch))
                {
                    response.SymbolsPeriods.Add(_dataSessions[symbol].SessionInformation.Info.Symbol, _dataSessions[symbol].SessionInformation.AvailableDataBarPeriods.ToArray());
                }
            }

            return response;
        }