Example #1
0
 internal async Task OnReplySuccess()
 {
     if (OnNewReply.HasDelegate)
     {
         await OnNewReply.InvokeAsync("");
     }
     await LoadData();
 }
Example #2
0
        private void ConnectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ((ToolStripMenuItem)sender).Enabled = false;

            ChangeTextMainStatusBar("Синхронизация с терминалом...");

            Trader.Connect();
            Trader.Objects.tTrades.OnNew += new Events.EventsBase <Trade> .eventElement(EventAllTrades);

            Trader.Objects.tOldTrades.OnNew += new Events.EventsBase <Trade> .eventElement(EventOldTrades);

            //Trader.Objects.tSecurities.OnNew += new Events.EventsBase<Securities>.eventElement(EventNewSec);

            Trader.Objects.tMyTrades.OnNew += new Events.EventsBase <MyTrade> .eventElement(EventMyTrades);

            Trader.Objects.tOrders.OnNew += new Events.EventsBase <Order> .eventElement(EventOrders);

            Trader.Objects.tOrders.OnChange += new Events.EventsBase <Order> .eventElement(EventOrders);

            Trader.Objects.tStopOrders.OnNew += new Events.EventsBase <StopOrder> .eventElement(EventStopOrders);

            Trader.Objects.tStopOrders.OnChange += new Events.EventsBase <StopOrder> .eventElement(EventStopOrders);

            Trader.Objects.tPortfolios.OnNew += new Events.EventsBase <Portfolio> .eventElement(EventPortfolio);

            //Trader.Objects.tPortfolios.OnChange += new Events.EventsBase<Portfolio>.eventElement(EventPortfolio);

            Trader.Objects.tPositions.OnNew += new Events.EventsBase <Position> .eventElement(EventPositions);

            Trader.Objects.tPositions.OnChange += new Events.EventsBase <Position> .eventElement(EventPositions);

            Trader.Objects.tTransaction.OnTransReply += new ToolsTrans.eventTrans((listReply) =>
            {
                Qlog.CatchException(() =>
                {
                    if (listReply.Count() > 0)
                    {
                        if (OnNewReply.NotIsNull())
                        {
                            OnNewReply(listReply);
                        }
                        Reply r = listReply.Last();
                        if (r.NotIsNull())
                        {
                            this.LastMarketReply = r;
                            ChangeTextMainStatusBar(r.ResultMsg);
                        }
                    }
                });
            });
        }