/// <summary> /// проверка на полноту обьекта, если полный, /// то переносим в главнуюю колекцию, которая будет идти в БД, /// а с темповой удаляем /// </summary> private static void RemovefromTempList(Log log) { if (log.MessageId != "" && log.Request != "" && log.Response != "") { LogsList.Add(log); TempLogsList.Remove(log); } }
private void btnLogs_ItemClick(object sender, ItemClickEventArgs e) { ClearPanel(); LogsList l = new LogsList(); l.Dock = DockStyle.Fill; scMain.SplitterPosition = l.Size.Width; scMain.Panel1.Enabled = true; scMain.Panel1.Controls.Add(l); ClearCheckDoCheck(btnLogs); }
public static void WriteToLog(LogMessage logMsg) { System.Windows.Application.Current.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action(() => { LogsList.Insert(0, logMsg); })); Console.WriteLine("{0}:{1}", logMsg.TimeStamp, logMsg.Message); }
/// <summary> /// this is called when information from the service server needs to be updated in web /// </summary> /// <param name="sender">who sends this</param> /// <param name="e">server info</param> private void UpdateInfoFromServer(object sender, ServiceInfoEventArgs e) { if (e.ConfigMap != null) { SetConfigInfo(e.ConfigMap); } if (e.LogsList != null) { foreach (Log log in e.LogsList) { LogsList.Add(log); } } }