Exemplo n.º 1
0
 private void OnMonitorUpdateServerInfo(object sender, PerformanceRecordEventArgs e)
 {
     if (this.IsHandleCreated && !this.IsDisposed)
     {
         this.BeginInvoke((MethodInvoker) delegate()
         {
             if (!chkShowPerformanceHistory.Checked)
             {
                 try
                 {
                     PerformanceRecord record = e.Data;
                     var now           = DateTime.Now;
                     var historyRecord = new HistoryRecord(record)
                     {
                         Date = now.ToString(), Value16 = now
                     };
                     currentRecords.Add(historyRecord);
                     AddPerformanceHistoryRecord(record, now, now, now.AddMinutes(1));
                     SetPerformanceInfo(record);
                 }
                 catch (Exception ex)
                 {
                     engine.DisablePerformance();
                     Monitor.Instance.ShowMessage(ex.Message);
                 }
             }
         });
     }
 }
Exemplo n.º 2
0
 private void OnUpdateServerInfo(PerformanceRecord Record, ServerInfo Server, bool IsServer)
 {
     UpdateServerInfo(this, new PerformanceRecordEventArgs()
     {
         Data = Record, Server = Server
     });
     if (Settings.Instance.LogHistory)
     {
         var record = new HistoryRecord(Record)
         {
             Date = DateTime.Now.ToString(),
             Key  = History.GetKey(Server, IsServer)
         };
         History.AddRecords(new List <HistoryRecord> {
             record
         });
     }
 }