public void ClearLogs() { AnalogyPageInformation analogyPage; lock (lockObject) { var oldMessages = allMessages.ToList(); pages = new List <DataTable>(); currentPageLength = 0; currentPageStartRowIndex = 0; currentPageNumber = 1; var first = Utils.DataTableConstructor(); currentTable = first; pages.Add(first); OnHistoryCleared?.Invoke(this, new AnalogyClearedHistoryEventArgs(oldMessages)); analogyPage = new AnalogyPageInformation(currentTable, 1, currentPageStartRowIndex); } OnPageChanged?.Invoke(this, new AnalogyPagingChanged(analogyPage)); }
public void ClearLogs() { lockSlim.EnterWriteLock(); var oldMessages = allMessages.ToList(); try { pages = new List <DataTable>(); currentPageStartRowIndex = 0; currentPageNumber = 1; var first = Utils.DataTableConstructor(); currentTable = first; pages.Add(first); } finally { lockSlim.ExitWriteLock(); } OnHistoryCleared?.Invoke(this, new AnalogyClearedHistoryEventArgs(oldMessages)); AnalogyPageInformation analogyPage = new AnalogyPageInformation(currentTable, 1, currentPageStartRowIndex); OnPageChanged?.Invoke(this, new AnalogyPagingChanged(analogyPage)); }