public MainWindow() { InitializeComponent(); // Determine where the EXE lives appDir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); // Tell NuixLogRepo where it can create its temp resources NuixLogRepo.RepoRootDirectory = System.IO.Path.Combine(appDir, "TempRepos"); repo = new NuixLogRepo(); rebuildSavedSearchesMenu(); }
/// <summary> /// Allows a user to select a directory. All files matching "nuix*.log*" are located and /// then loaded using loadLogFiles method. /// </summary> private void menuLoadDirectory_Click(object sender, RoutedEventArgs e) { VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog(); if (dialog.ShowDialog() == true) { string selectedDirectory = dialog.SelectedPath; string[] logFiles = System.IO.Directory.GetFiles(selectedDirectory, "nuix*.log*", System.IO.SearchOption.AllDirectories); // Dispose of current repo NuixLogRepo prev = repo; repo = new NuixLogRepo(); prev.DisposeRepo(); loadLogFiles(logFiles); } }
/// <summary> /// Allows a user to select one or more individual log files to be loaded using loadLogFiles method. /// </summary> private void menuLoadNuixLogs_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); ofd.Title = "Load Nuix Logs"; ofd.Filter = "Nuix Logs|nuix*.log*;*.log"; ofd.Multiselect = true; ofd.InitialDirectory = System.IO.Path.Combine(Environment.GetEnvironmentVariable("LocalAppData"), @"Nuix\Logs"); if (ofd.ShowDialog() == true) { // Dispose of current repo NuixLogRepo prev = repo; repo = new NuixLogRepo(); prev.DisposeRepo(); string[] filesToLoad = ofd.FileNames; loadLogFiles(filesToLoad); } }