Beispiel #1
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            _logWindow = new LogWindow();
            _agent     = new TradeAgent(this);
            _config    = _agent.Config;
            _logWindow.SetConfig(_config);
            _character = _agent.ActiveCharacter;

            TimerOrderListRedraw.Elapsed += new System.Timers.ElapsedEventHandler(RedrawIntervalElapsedHandler);
            TimerOrderListRedraw.Start();
        }
Beispiel #2
0
        public void DrawOrderList()
        {
            TimerOrderListRedraw.Stop();

            if (!_agent.IsOrderListOccupied)
            {
                _agent.IsOrderListOccupied = true;

                if (_firstDraw)
                {
                    try
                    {
                        OrderList.SetObjects(_agent.OrderSet.Orders);
                        _firstDraw = false;
                    }
                    catch (Exception e)
                    {
                        Log.WriteLog("Error while trying to draw order list:");
                        Log.WriteLog(e);
                    }
                }
                else
                {
                    try
                    {
                        OrderList.BuildList(true);
                    }
                    catch (Exception e)
                    {
                        Log.WriteLog("Error while trying to redraw order list:");
                        Log.WriteLog(e);
                    }
                }

                _agent.IsOrderListOccupied = false;
            }

            TimerOrderListRedraw.Start();
        }