/* ----------------------------------------------------------------- */ /// /// ExtractDirectory /// /// <summary> /// Initializes a new instance of the ExtractDirectory class with /// the specified arguments. /// </summary> /// /// <param name="src">Path of the root directory.</param> /// <param name="settings">User settings.</param> /// /* ----------------------------------------------------------------- */ public ExtractDirectory(string src, SettingFolder settings) : this( src, settings.Value.Extract.SaveMethod, settings.Value.Extract.Filtering ? settings.Value.GetFilters() : Enumerable.Empty <string>() ) { }
static void Main(string[] args) => Source.LogError(() => { if (args.Length <= 0) { return; } _ = Logger.ObserveTaskException(); Source.LogInfo(Source.Assembly); Source.LogInfo($"[ {args.Join(" ")} ]"); var ss = new SettingFolder(); ss.Load(); if (ss.Value.AlphaFS) { Io.Configure(new AlphaFS.IoController()); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var src = new Request(args); var view = new ProgressWindow(); switch (src.Mode) { case Mode.Compress: Show(view, new CompressViewModel(src, ss)); break; case Mode.Extract: if (IsBurst(src, ss)) { Burst(src); } else { Show(view, new ExtractViewModel(src, ss)); } break; default: break; } });
/* ----------------------------------------------------------------- */ /// /// ExtractFacade /// /// <summary> /// Initializes a new instance of the ExtractFacade class with /// the specified arguments. /// </summary> /// /// <param name="src">Request of the process.</param> /// <param name="settings">User settings.</param> /// /* ----------------------------------------------------------------- */ public ExtractFacade(Request src, SettingFolder settings) : base(src, settings) { }
/* ----------------------------------------------------------------- */ /// /// ArchiveFacade /// /// <summary> /// Initializes a new instance of the ArchiveFacade class with the /// specified arguments. /// </summary> /// /// <param name="src">Request of the process.</param> /// <param name="settings">User settings.</param> /// /* ----------------------------------------------------------------- */ protected ArchiveFacade(Request src, SettingFolder settings) { Request = src; Settings = settings; }
/* ----------------------------------------------------------------- */ /// /// IsBurst /// /// <summary> /// Determines whether to extract the two or more archives at the /// same time. /// </summary> /// /* ----------------------------------------------------------------- */ static bool IsBurst(Request src, SettingFolder ss) => src.Sources.Count() > 1 && ss.Value.Extract.Bursty && !src.SuppressRecursive;
/* ----------------------------------------------------------------- */ /// /// CompressFacade /// /// <summary> /// Initializes a new instance of the CompressFacade class with the /// specified arguments. /// </summary> /// /// <param name="src">Request of the process.</param> /// <param name="settings">User settings.</param> /// /* ----------------------------------------------------------------- */ public CompressFacade(Request src, SettingFolder settings) : base(src, settings) { }
/* ----------------------------------------------------------------- */ /// /// ExtractViewModel /// /// <summary> /// Initializes a new instance of the ExtractViewModel class /// with the specified arguments. /// </summary> /// /// <param name="src">Request of the process.</param> /// <param name="settings">User settings.</param> /// <param name="context">Synchronization context.</param> /// /* ----------------------------------------------------------------- */ public ExtractViewModel(Request src, SettingFolder settings, SynchronizationContext context) : this(new(src, settings), context)
/* ----------------------------------------------------------------- */ /// /// ExtractViewModel /// /// <summary> /// Initializes a new instance of the ExtractViewModel class /// with the specified arguments. /// </summary> /// /// <param name="src">Request of the process.</param> /// <param name="settings">User settings.</param> /// /* ----------------------------------------------------------------- */ public ExtractViewModel(Request src, SettingFolder settings) : this(src, settings, SynchronizationContext.Current) { }