private void Import_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { InitialDirectory = Directory.GetCurrentDirectory(), Filter = "CSV File (*.csv)|*.csv", ReadOnlyChecked = true }; if (openFileDialog.ShowDialog() != true) { return; } var file = openFileDialog.FileName; List <IShellItem> csvShelltems = CsvIO.ImportCSVFile(file); if (csvShelltems.Count == 0) { LogAggregator.Instance.ShowIfNotEmpty(); return; } if (App.ShellItems != null) { App.ShellItems.Clear(); } if (App.nodeCollection.nodeList != null) { App.nodeCollection.nodeList.Clear(); } App.ShellItems = csvShelltems; List <IEvent> events = EventParser.GetEvents(App.ShellItems); App.nodeCollection.ClearAllFilters(); App.nodeCollection.nodeList.AddRange(NodeParser.GetNodes(events)); if (Home.timelinePage == null) { Home.timelinePage = new TimelinePage(); App.NavigationService.Navigate(Home.timelinePage); } else { Home.timelinePage.RebuildTimeline(); string timelinePageKey = "timelinepage"; if (App.pages.ContainsKey(timelinePageKey)) { App.NavigationService.Navigate(App.pages[timelinePageKey]); } else { App.NavigationService.Navigate(Home.timelinePage); } } LogAggregator.Instance.ShowIfNotEmpty(); }
public void EventListOutput() { List <IShellItem> shellItems = new List <IShellItem>(); Dictionary <string, string> shellItemProperties = new Dictionary <string, string>(); shellItemProperties.Add("Size", "0"); shellItemProperties.Add("Type", "31"); shellItemProperties.Add("TypeName", "Some Type Name"); shellItemProperties.Add("Name", "Some Name"); shellItemProperties.Add("ModifiedDate", "1/1/2010 12:00:00 AM"); shellItemProperties.Add("AccessedDate", "2/1/2000 12:00:00 AM"); shellItemProperties.Add("CreationDate", "1/1/2019 12:00:00 AM"); shellItemProperties.Add("LastAccessedDate", "1/1/2016 12:00:00 AM"); CsvParsedShellItem ShellItem = new CsvParsedShellItem(shellItemProperties); shellItems.Add(ShellItem); List <IEvent> newList = EventParser.GetEvents(shellItems); Assert.IsNotNull(newList); foreach (var el in newList) { Assert.AreSame(el.Parent, ShellItem); } }
private async void ParseButton_Click(object sender, RoutedEventArgs e) { if (!ConfigurationFilesAreValid()) { return; } if (OfflineCheck.IsChecked == true) { if (!OfflineSelectionsAreValid()) { return; } } //cover UI ShowParsingInProgress(true); //begin the parsing process Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); try { List <IShellItem> shellItems = await ParseShellBags(); if (shellItems.Count == 0) { LogAggregator.Instance.ShowIfNotEmpty(); ShowParsingInProgress(false); return; } App.ShellItems = shellItems; List <IEvent> events = EventParser.GetEvents(App.ShellItems); if (App.nodeCollection.nodeList != null) { App.nodeCollection.nodeList.Clear(); } App.nodeCollection.ClearAllFilters(); App.nodeCollection.nodeList.AddRange(NodeParser.GetNodes(events)); } catch (System.Security.SecurityException) { showErrorMessage("Please exit the program and run SeeShells as an administrator to parse a live registry.", "Access Denied"); ShowParsingInProgress(false); return; } stopwatch.Stop(); logger.Info("Parsing Complete. ShellItems Parsed: " + App.ShellItems.Count + ". Time Elapsed: " + stopwatch.ElapsedMilliseconds / 1000 + " seconds"); //Restore UI ShowParsingInProgress(false); //Go to Timeline if (timelinePage == null) { timelinePage = new TimelinePage(); NavigationService.Navigate(timelinePage); } else { timelinePage.RebuildTimeline(); NavigationService.Navigate(timelinePage); } App.NavigationService = NavigationService; if (!(App.pages.ContainsKey("timelinepage"))) { App.pages.Add("timelinepage", timelinePage); } }