Пример #1
0
        /// <summary>
        /// Creates an ArgumentCommand from a valid 7z command and the archive for it to target.
        /// </summary>
        /// <param name="command">The command to use on the archive.</param>
        /// <param name="archive">The filename of the archive.</param>
        public static ArgumentCommand ToArgument(this SevenZipCommands command, string archive)
        {
            switch (command)
            {
            case SevenZipCommands.Add:
                return(new ArgumentCommand("a", archive));

            case SevenZipCommands.Extract:
                return(new ArgumentCommand("e", archive));

            case SevenZipCommands.Delete:
                return(new ArgumentCommand("d", archive));

            case SevenZipCommands.List:
                return(new ArgumentCommand("l", archive));

            case SevenZipCommands.Test:
                return(new ArgumentCommand("t", archive));

            case SevenZipCommands.Update:
                return(new ArgumentCommand("u", archive));

            case SevenZipCommands.ExtractWithStructure:
                return(new ArgumentCommand("x", archive));
            }
            return(null);
        }
Пример #2
0
 /// <summary>
 /// Adds a command to be compiled.
 /// </summary>
 /// <param name="c">The specific command to be used.</param>
 /// <param name="archive">The archive that is targeted.</param>
 public ArgumentBuilder AddCommand(SevenZipCommands c, string archive)
 {
     return(AddCommand(c.ToArgument(archive)));
 }