Пример #1
0
        void ControleListaAtivos_Load(object sender, EventArgs e)
        {
            // Referencia aos serviços
            _servicoOrdens = Ativador.Get <IServicoOrdens>();
            _servicoCanais = Ativador.Get <IServicoCanaisNegociacao>();

            // Pede lista de ativos
            System.Threading.ThreadPool.QueueUserWorkItem(
                new System.Threading.WaitCallback(
                    delegate(object parametros)
            {
                ListarInstrumentosResponse listarInstrumentosResponse =
                    _servicoOrdens.ListarInstrumentos(
                        new ListarInstrumentosRequest()
                {
                    CodigoMensagem = "reqi01",
                    CodigoBolsa    = "BMF",
                    CodigoCliente  = "123",
                    DataReferencia = DateTime.Now
                });
                var t = from s in listarInstrumentosResponse.Instrumentos
                        select new InstrumentoInfo()
                {
                    Symbol = s
                };
                grdInstrumentos.Invoke(
                    new InvokeDelegate(
                        delegate()
                {
                    grdInstrumentos.DataSource = new List <InstrumentoInfo>(t);
                }));
            }));
        }
Пример #2
0
        private void cmdListarInstrumentos_Click(object sender, EventArgs e)
        {
            // Pede lista de ativos
            ListarInstrumentosResponse listarInstrumentosResponse =
                _servicoOrdens.ListarInstrumentos(
                    new ListarInstrumentosRequest()
            {
                CodigoMensagem = "reqi01",
                CodigoBolsa    = "BOVESPA",
                CodigoCliente  = "123",
                DataReferencia = DateTime.Now
            });
            var t = from s in listarInstrumentosResponse.Instrumentos
                    select new InstrumentoInfo()
            {
                Symbol = s
            };

            grdInstrumentos.DataSource = new List <InstrumentoInfo>(t);

            // Seleciona tab de instrumentos
            tab.SelectedTab = tabInstrumentos;
        }