Esempio n. 1
0
        /// <summary>
        /// Specify that the files that are added should be added as large files if they're above a specific
        /// size, in megabytes, otherwise they should be added as normal files.
        /// </summary>
        /// <param name="command">
        /// The <see cref="AddCommand"/> to modify.
        /// </param>
        /// <param name="size">
        /// The size threshold, in megabytes, of which files above this size should be added as large files.
        /// </param>
        /// <returns>
        /// The <see cref="AddCommand"/>, for a fluent interface.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="command"/> is <c>null</c>.
        /// </exception>
        /// <exception cref="ArgumentOutOfRangeException">
        /// <paramref name="size"/> is less than 1.
        /// </exception>
        public static AddCommand WithAddAllFilesAboveSizeAsLargeFiles(this AddCommand command, int size)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }
            if (size < 1)
            {
                throw new ArgumentOutOfRangeException("size", size, "size must be 1 or higher");
            }

            command.AddArgument("--lfsize");
            command.AddArgument(size.ToString(CultureInfo.InvariantCulture));
            return(command);
        }
Esempio n. 2
0
        /// <summary>
        /// Specify that the files that are added should be added as large files.
        /// </summary>
        /// <param name="command">
        /// The <see cref="AddCommand"/> to modify.
        /// </param>
        /// <returns>
        /// The <see cref="AddCommand"/>, for a fluent interface.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="command"/> is <c>null</c>.
        /// </exception>
        public static AddCommand WithAddAsLargeFile(this AddCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            command.AddArgument("--large");
            return(command);
        }
Esempio n. 3
0
        /// <summary>
        /// Completely skip checks related to case-collision problems.
        /// </summary>
        /// <param name="command">
        /// The <see cref="AddCommand"/> to modify.
        /// </param>
        /// <returns>
        /// The specified <see cref="AddCommand"/> <paramref name="command"/> object, for the
        /// fluent interface.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">
        /// <para><paramref name="command"/> is <c>null</c>.</para>
        /// </exception>
        /// <exception cref="System.InvalidOperationException">
        /// The CaseGuard extension is not installed and active.
        /// </exception>
        public static AddCommand WithoutCaseGuarding(this AddCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }
            if (!CaseGuardExtension.IsInstalled)
            {
                throw new InvalidOperationException("The caseguard extension is not installed and active");
            }

            command.AddArgument("--unguard");
            return(command);
        }