private void PersistResults(DateTime startDate, DateTime endDate, IEnumerable <string> phrases) { var matchingFile = new PersistanceManager.MatchingFile(_searchFile, _searchPhrase, 0, _matches); var matchingFiles = new List <PersistanceManager.MatchingFile>() { matchingFile }; var processedFilesCount = 1u; var storedSearch = new PersistanceManager.Search(startDate, endDate, processedFilesCount, phrases, matchingFiles); // TODO: Remove magic db name string var persistanceManager = new PersistanceManager.SqLitePersistanceManager("db.s3db"); persistanceManager.SaveSearch(storedSearch); }
internal void RenderDatabaseHistory(string dbPath, ListView dbContentListView) { var history = new PersistanceManager.SqLitePersistanceManager(dbPath).GetFullHistory(); dbContentListView.Items.Clear(); dbContentListView.View = View.Details; foreach (var historyItem in history) { var startTime = historyItem.StartTime.ToString(); var endTime = historyItem.StartTime.ToString(); var files = Convert.ToString(historyItem.ProcessedFilesCount); var searchPhrases = String.Join(" ", historyItem.Phrases); var listItem = new ListViewItem(new[] { startTime, endTime, files, searchPhrases }); listItem.Tag = new SearchResultAdapter(historyItem); dbContentListView.Items.Add(listItem); } dbContentListView.Refresh(); }
private void PersistResults(DateTime startDate, DateTime endDate, IEnumerable<string> phrases) { var matchingFile = new PersistanceManager.MatchingFile(_searchFile, _searchPhrase, 0, _matches); var matchingFiles = new List<PersistanceManager.MatchingFile>() { matchingFile }; var processedFilesCount = 1u; var storedSearch = new PersistanceManager.Search(startDate, endDate, processedFilesCount, phrases, matchingFiles); // TODO: Remove magic db name string var persistanceManager = new PersistanceManager.SqLitePersistanceManager("db.s3db"); persistanceManager.SaveSearch(storedSearch); }