Пример #1
0
 public void Handle(QueryHistoryEvent message)
 {
     QueryHistory.Add(message);
     while (QueryHistory.Count > _globalOptions.QueryHistoryMaxItems)
     {
         QueryHistory.RemoveAt(0);
     }
     SaveHistoryFile(message);
 }
Пример #2
0
 public static void AddQueryHistory(string uid)
 {
     if (!QueryHistory.Contains(uid))
     {
         MainWindow.ComboBoxUserId.Items.Add(uid);
         QueryHistory.Add(uid);
         if (QueryHistory.Count > MAX_QUERY_HISTORY_COUNT)
         {
             MainWindow.ComboBoxUserId.Items.RemoveAt(0);
             QueryHistory.RemoveAt(0);
         }
     }
 }
Пример #3
0
 public async Task Handle(QueryHistoryEvent message)
 {
     // don't add a history record if the query text is empty
     if (string.IsNullOrWhiteSpace(message.QueryText))
     {
         Log.Debug("{class} {method} {message}", nameof(GlobalQueryHistory), "Handle<QueryHistoryEvent>", "Skipping saving Query History as QueryText is empty");
         return;
     }
     QueryHistory.Add(message);
     while (QueryHistory.Count > _globalOptions.QueryHistoryMaxItems)
     {
         QueryHistory.RemoveAt(0);
     }
     await SaveHistoryFileAsync(message);
 }