Ejemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// Select
        ///
        /// <summary>
        /// Gets the directory to save the compressed archive file.
        /// The method may query the user as needed.
        /// </summary>
        ///
        /// <param name="src">Source object.</param>
        /// <param name="settings">Runtime compress settings.</param>
        ///
        /// <returns>Path to save.</returns>
        ///
        /* ----------------------------------------------------------------- */
        public static string Select(this CompressFacade src, CompressRuntimeSetting settings)
        {
            if (settings.Destination.HasValue())
            {
                return(settings.Destination);
            }

            var ss  = src.Settings.Value.Compress;
            var cvt = new ArchiveName(src.Request.Sources.First(), src.Request.Format);
            var obj = new SaveQueryProxy(src.Select, cvt.Value.FullName, src.Request, ss)
            {
                Format = cvt.Format,
            };

            if (obj.Location == SaveLocation.Query)
            {
                return(obj.Value);
            }

            var dest = Io.Combine(obj.Value, cvt.Value.Name);

            return(Io.Exists(dest) && ss.OverwritePrompt ? obj.Invoke() : dest);
        }
Ejemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 ///
 /// GetTitle
 ///
 /// <summary>
 /// Gets the title displayed in the main window.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 ///
 /// <returns>Title displayed in the main window.</returns>
 ///
 /* ----------------------------------------------------------------- */
 public static string GetTitle(this CompressFacade src) => src.GetTitle(src.Destination);
Ejemplo n.º 3
0
 /* ----------------------------------------------------------------- */
 ///
 /// GetText
 ///
 /// <summary>
 /// Gets the text displayed in the main window.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 ///
 /// <returns>Text that represents the current status.</returns>
 ///
 /* ----------------------------------------------------------------- */
 public static string GetText(this CompressFacade src) =>
 src.Destination.HasValue() ?
 string.Format(Properties.Resources.MessageArchive, src.Destination) :
 Properties.Resources.MessagePreArchive;