Example #1
0
 private void BtnStartStopClick(object sender, EventArgs e)
 {
     if (btnStartStop.Text == "Start")
     {
         btnStartStop.Text = "Stop";
         State = GridMonState.WatchGrid;
     }
     else
     {
         btnStartStop.Text = "Start";
         State = GridMonState.Idle;
     }
 }
Example #2
0
        private void OnFrame(object sender, EventArgs e)
        {
            if (State == GridMonState.Idle)
            {
                return;
            }

            // Wait for the next action
            if (_nextAction >= DateTime.Now)
            {
                return;
            }

            switch (State)
            {
                case GridMonState.WatchGrid:
                    Log("WatchGrid...");
                    foreach (var entity in DirectEve.Entities)
                    {
                        if (entity.IsPc)
                        {
                            LogEntity("{0} {1} {2} {3} {4} {5}", entity);
                            // AppendSQL
                        }
                    }
                    State = GridMonState.WatchLocal;
                    _nextAction = DateTime.Now.AddMilliseconds(WaitMillis);
                    break;

                case GridMonState.WatchLocal:
                    Log("WatchLocal...");
                    State = GridMonState.WatchGrid;
                    break;
            }
        }