// Public members

        public override bool TestRequirement(IServiceProvider serviceProvider)
        {
            IArchiveFactoryOptions archiveFactoryOptions = serviceProvider?.GetService <IArchiveFactoryOptions>();

            if (archiveFactoryOptions is null)
            {
                return(false);
            }

            return(File.Exists(Path.Combine(archiveFactoryOptions.SevenZipDirectoryPath, SevenZipUtilities.SevenZipExecutableFilename)) ||
                   File.Exists(SevenZipUtilities.SevenZipExecutablePath));
        }
Example #2
0
        public ArchiveFactory(IPluginLoader pluginLoader, IArchiveFactoryOptions options)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (pluginLoader is null)
            {
                this.pluginLoader = new Lazy <IPluginLoader>(CreateDefaultPluginLoader);
            }
            else
            {
                this.pluginLoader = new Lazy <IPluginLoader>(() => pluginLoader);
            }

            this.options = options;
        }
 public BinSevenZipArchiveFactory(IArchiveFactoryOptions options)
 {
     this.options = options;
 }
Example #4
0
 public ArchiveFactory(IArchiveFactoryOptions options) :
     this(null, options)
 {
 }
Example #5
0
 public WinrarArchiveFactory(IArchiveFactoryOptions options)
 {
     this.options = options;
 }