public void CheckPerformance()
        {
            try
            {
                if (RequestServer != null)
                {
                    var e = new ServerInfoEventArgs();
                    RequestServer(this, e);
                    if (!e.Cancel)
                    {
                        MonitorEngine.Instance.AddUserPerformanceItem(e.Server, e.IsServer);
                        CheckPerformanceItem(e.Server, e.IsServer);
                    }
                }

                if (this.Equals(MonitorEngine.Instance))
                {
                    Settings.Instance.PerformanceItems.ForEach(i =>
                    {
                        var exists = MonitorEngine.Instance.userPerformanceItems.Exists(p => p.Server == i.Server &&
                                                                                        p.Database == i.Database && p.IsServer == i.IsServer);
                        if (!exists)
                        {
                            CheckPerformanceItem(i, i.IsServer);
                        }
                    });
                }
            }
            catch (Exception ex)
            {
                OnError(ex);
            }
        }
Exemple #2
0
 private void OnMonitorEngineRequestServer(object sender, ServerInfoEventArgs e)
 {
     e.IsServer = objectMode == ObjectModes.Server;
     e.Server   = server;
     e.Cancel   = server == null;
 }