예제 #1
0
        public void NodeCollectionCreationTest()
        {
            List <IEvent> eventList = new List <IEvent>();
            IEvent        aEvent    = new MockEvent("item1", DateTime.Now, null, "Access");

            eventList.Add(aEvent);
            App.nodeCollection.nodeList = NodeParser.GetNodes(eventList);
            Assert.AreNotEqual(App.nodeCollection.nodeList.Count, 0);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
            }
        }