コード例 #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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>()
         )
 {
 }
コード例 #2
0
        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;
            }
        });
コード例 #3
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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)
 {
 }
コード例 #4
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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;
 }
コード例 #5
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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;
コード例 #6
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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)
 {
 }
コード例 #7
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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)
コード例 #8
0
 /* ----------------------------------------------------------------- */
 ///
 /// 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)
 {
 }