public void UpdateSessionConfig(HunterConfig config) { _session.ReplaceConfig(config); // This will most likely need to be changed in the future. //OnSubmissionListChanged?.Invoke(); }
/// <summary> /// Does the current target folder have a report in it? /// </summary> /// <returns><c>true</c>, if it exists, <c>false</c> otherwise.</returns> public bool HasReport() { if (File.Exists(HunterConfig.GetReportPath(WorkingDirectory))) { return(true); } return(false); }
/// <summary> /// Open the current target folders report, if it exists. /// </summary> public void OpenReport() { if (HasReport()) { #if __MACOS__ Platform.Run("open", HunterConfig.GetReportPath(WorkingDirectory), true); #else Platform.Run(HunterConfig.GetReportPath(WorkingDirectory), string.Empty, true); #endif } }
/// <summary> /// Pre proces setup work on the target folder /// </summary> public void PreProcess() { // Make sure we have our data folder if (!Directory.Exists(HunterConfig.GetDataPath(WorkingDirectory))) { Directory.CreateDirectory(HunterConfig.GetDataPath(WorkingDirectory)); } // We're going to create a list of the files ahead of time for now _session.AddPathForSubmission(WorkingDirectory); // Add base level submission filters _session.AddFilterForSubmission(new Core.Submissions.SubmissionFilters.DefaultSubmissionFilter()); // User space exclusions _session.AddFilterForSubmission(new Core.Submissions.SubmissionFilters.FileExtensionSubmissionFilter(_session.Config.SharedIgnoredFileExtensions)); _session.AddFilterForSubmission(new Core.Submissions.SubmissionFilters.FileNameSubmissionFilter(_session.Config.SharedIgnoredFiles)); _session.AddFilterForSubmission(new Core.Submissions.SubmissionFilters.DirectoryNameSubmissionFilter(_session.Config.SharedIgnoredFolders)); // Create our list of submissions (we'll change this later to have selection) _session.CreateSubmissions(); }
/// <summary> /// Initializes a new instance of the <see cref="T:Galileo.Client.Mac.ConfigDataSource"/> class /// </summary> /// <param name="config">The hunter config to parse into objects</param> public ConfigDataSource(HunterConfig config) { Items = ProcessConfig.GetDataSourceObject(config); }
/// <summary> /// Get the path to the report for the current target folder. /// </summary> /// <returns>The report's path.</returns> public string GetReportPath() { return(HunterConfig.GetReportPath(WorkingDirectory)); }
internal SettingsSection(HunterConfig config) { StringBuilder layout = new StringBuilder(); layout.Append(CreateHeader()); // !!!! Need to create rows for every two sections !!! // Row 1 layout.Append(CreateRowHeader()); // Shared Settings layout.Append(CreateTableHeader(SettingsLocalization.SharedSettingsTitle)); layout.Append(CreateTableItem(HunterConfigSerialization.SharedIgnoredFolders, config.SharedIgnoredFolders.GetString())); layout.Append(CreateTableItem(HunterConfigSerialization.SharedIgnoredFiles, config.SharedIgnoredFiles.GetString())); layout.Append(CreateTableItem(HunterConfigSerialization.SharedIgnoredFileExtensions, config.SharedIgnoredFileExtensions.GetString())); layout.Append(CreateTableItem(HunterConfigSerialization.SharedIgnoredUsernames, config.SharedIgnoredUsernames.GetString())); layout.Append(CreateTableFooter()); // File Settings layout.Append(CreateTableHeader(SettingsLocalization.FileSettingsTitle)); layout.Append(CreateTableItem(HunterConfigSerialization.CheckFileName, config.CheckFileName.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckFileNameThreshold, config.CheckFileNameThreshold.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckFileNameWeight, config.CheckFileNameWeight.ToString())); layout.Append(CreateTableFooter()); layout.Append(CreateRowFooter()); // Row 2 layout.Append(CreateRowHeader()); // Meta Data Settings layout.Append(CreateTableHeader(SettingsLocalization.MetaDataSettingsTitle)); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaCreator, config.CheckMetaCreator.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaCreatorWeight, config.CheckMetaCreatorWeight.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateCreated, config.CheckMetaDateCreated.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateCreatedWeight, config.CheckMetaDateCreatedWeight.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateLastPrinted, config.CheckMetaDateLastPrinted.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateLastPrintedWeight, config.CheckMetaDateLastPrintedWeight.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateModified, config.CheckMetaDateModified.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaDateModifiedWeight, config.CheckMetaDateModifiedWeight.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaLastModifiedBy, config.CheckMetaLastModifiedBy.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckMetaLastModifiedByWeight, config.CheckMetaLastModifiedByWeight.ToString())); layout.Append(CreateTableFooter()); // Content Settings layout.Append(CreateTableHeader(SettingsLocalization.ContentSettingsTitle)); layout.Append(CreateTableItem(HunterConfigSerialization.CheckContent, config.CheckContent.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckContentThreshold, config.CheckContentThreshold.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckContentMaximumLength, config.CheckContentMaximumLength.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.CheckContentWeight, config.CheckContentWeight.ToString())); layout.Append(CreateTableFooter()); layout.Append(CreateRowFooter()); // Row 3 layout.Append(CreateRowHeader()); // Process Settings layout.Append(CreateTableHeader(SettingsLocalization.ProcessSettingsTitle)); layout.Append(CreateTableItem(HunterConfigSerialization.ProcessArchivesExtract, config.ProcessArchivesExtract.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.ProcessArchivesExtractOnlySubmissions, config.ProcessArchivesExtractOnlySubmissions.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.ProcessArchivesDelete, config.ProcessArchivesDelete.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.ProcessReportEmbedResources, config.ProcessReportEmbedResources.ToString())); layout.Append(CreateTableItem(HunterConfigSerialization.ProcessNameIgnore, config.ProcessNameIgnore.GetString())); layout.Append(CreateTableFooter()); layout.Append(CreateRowFooter()); layout.Append(CreateFooter()); _cache = layout.ToString(); }