/// <summary>
        ///
        /// </summary>
        public bool BeginOrdersInformationUpdate(AccountInfo accountInfo, string[] orderIds,
                                                 out string operationResultMessage)
        {
            if (OperationalState != OperationalStateEnum.Operational)
            {
                operationResultMessage = "Attempted operations on non operational order executioner.";
                SystemMonitor.Error(operationResultMessage);
                return(false);
            }

            if (orderIds == null || orderIds.Length == 0)
            {
                operationResultMessage = "No informations required, none retrieved.";
                return(true);
            }

            GetOrdersInformationMessage message = new GetOrdersInformationMessage(accountInfo, orderIds);

            message.RequestResponse    = false;
            message.PerformSynchronous = false;

            this.SendResponding(SourceTransportInfo, message);

            //if (responceMessage == null)
            //{
            //    operationResultMessage = "Getting order information failed due to time out.";
            //    return false;
            //}
            //else
            //    if (responceMessage.OperationResult == false)
            //    {
            //        operationResultMessage = responceMessage.OperationResultMessage;
            //        return false;
            //    }

            operationResultMessage = string.Empty;
            return(true);
        }
        AccountResponceMessage Receive(GetOrdersInformationMessage message)
        {
            IImplementation implementation = _implementation;

            if (implementation == null || OperationalState != OperationalStateEnum.Operational)
            {
                if (message.RequestResponce)
                {
                    return(new AccountResponceMessage(message.AccountInfo, false));
                }

                return(null);
            }

            string operationResultMessage;

            OrderInfo[] orderInfos;
            bool        operationResult = implementation.GetOrdersInfos(message.AccountInfo, message.OrderTickets, out orderInfos, out operationResultMessage);

            OrdersInformationUpdateResponceMessage responce = new OrdersInformationUpdateResponceMessage(message.AccountInfo,
                                                                                                         orderInfos, operationResult);

            responce.ResultMessage = operationResultMessage;

            if (message.RequestResponce)
            {
                return(responce);
            }
            else
            {
                if (operationResult)
                {
                    SendResponding(message.TransportInfo, responce);
                }
            }
            return(null);
        }
        OrdersInformationUpdateResponceMessage Receive(GetOrdersInformationMessage message)
        {
            TracerHelper.TraceEntry();

            List<OrderInfo> result = new List<OrderInfo>();
            lock (this)
            {
                foreach (string id in message.OrderTickets)
                {
                    if (_orders.ContainsKey(id) && _orders[id].HasValue)
                    {
                        result.Add(_orders[id].Value);
                    }
                    else
                    {
                        _pendingOrdersInformations.Add(id);
                    }
                }
            }

            TracerHelper.TraceExit();

            OrdersInformationUpdateResponceMessage responce = new OrdersInformationUpdateResponceMessage(_accountInfo, result.ToArray(), true);

            if (message.RequestResponce)
            {
                return responce;
            }

            SendToSubscribers(responce);
            return null;
        }
        /// <summary>
        /// 
        /// </summary>
        public bool BeginOrdersInformationUpdate(AccountInfo accountInfo, string[] orderIds,
            out string operationResultMessage)
        {
            if (OperationalState != OperationalStateEnum.Operational)
            {
                operationResultMessage = "Attempted operations on non operational order executioner.";
                SystemMonitor.Error(operationResultMessage);
                return false;
            }

            if (orderIds == null || orderIds.Length == 0)
            {
                operationResultMessage = "No informations required, none retrieved.";
                return true;
            }

            GetOrdersInformationMessage message = new GetOrdersInformationMessage(accountInfo, orderIds);
            message.RequestResponse = false;
            message.PerformSynchronous = false;

            this.SendResponding(SourceTransportInfo, message);

            //if (responceMessage == null)
            //{
            //    operationResultMessage = "Getting order information failed due to time out.";
            //    return false;
            //}
            //else
            //    if (responceMessage.OperationResult == false)
            //    {
            //        operationResultMessage = responceMessage.OperationResultMessage;
            //        return false;
            //    }

            operationResultMessage = string.Empty;
            return true;
        }
        AccountResponseMessage Receive(GetOrdersInformationMessage message)
        {
            IImplementation implementation = _implementation;
            if (implementation == null || OperationalState != OperationalStateEnum.Operational)
            {
                if (message.RequestResponse)
                {
                    return new AccountResponseMessage(message.AccountInfo, false);
                }

                return null;
            }

            string operationResultMessage;
            OrderInfo[] orderInfos;
            bool operationResult = implementation.GetOrdersInfos(message.AccountInfo, message.OrderTickets, out orderInfos, out operationResultMessage);

            OrdersInformationUpdateResponseMessage response = new OrdersInformationUpdateResponseMessage(message.AccountInfo,
                orderInfos, operationResult);
            response.ResultMessage = operationResultMessage;

            if (message.RequestResponse)
            {
                return response;
            }
            else
            {
                if (operationResult)
                {
                    SendResponding(message.TransportInfo, response);
                }
            }
            return null;
        }