/// <summary> /// Show the copy file dialog. /// </summary> /// <param name="repository"> /// The <see cref="Repository"/> to copy files in. /// </param> /// <param name="command"> /// Any extra options to the copy method, or <c>null</c> for default options. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="repository"/> is <c>null</c>.</para> /// </exception> /// <remarks> /// This command is only available for the <see cref="GuiClientType.PyQT"/> client type. /// </remarks> public static void CopyGui(this Repository repository, CopyGuiCommand command = null) { if (repository == null) throw new ArgumentNullException("repository"); command = command ?? new CopyGuiCommand(); repository.Execute(command); }
/// <summary> /// Show the copy file dialog. /// </summary> /// <param name="repository"> /// The <see cref="Repository"/> to copy files in. /// </param> /// <param name="source"> /// The source file to copy. /// </param> /// <param name="destination"> /// The destination to copy it to. /// </param> /// <param name="command"> /// Any extra options to the copy method, or <c>null</c> for default options. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="repository"/> is <c>null</c>.</para> /// <para>- or -</para> /// <para><paramref name="source"/> is <c>null</c> or empty.</para> /// <para>- or -</para> /// <para><paramref name="destination"/> is <c>null</c> or empty.</para> /// </exception> /// <exception cref="ArgumentException"> /// <para><see cref="MoveCopyRenameGuiCommandBase{T}.Source"/> cannot be set before calling this method.</para> /// <para>- or -</para> /// <para><see cref="MoveCopyRenameGuiCommandBase{T}.Destination"/> cannot be set before calling this method.</para> /// </exception> /// <remarks> /// This command is only available for the <see cref="GuiClientType.PyQT"/> client type. /// </remarks> public static void CopyGui(this Repository repository, string source, string destination, CopyGuiCommand command = null) { if (repository == null) throw new ArgumentNullException("repository"); if (StringEx.IsNullOrWhiteSpace(source)) throw new ArgumentNullException("source"); if (StringEx.IsNullOrWhiteSpace(destination)) throw new ArgumentNullException("destination"); if (command != null && !StringEx.IsNullOrWhiteSpace(command.Source)) throw new ArgumentException("CopyGuiCommand.Source cannot be set before calling this method", "command"); if (command != null && !StringEx.IsNullOrWhiteSpace(command.Destination)) throw new ArgumentException("CopyGuiCommand.Destination cannot be set before calling this method", "command"); command = (command ?? new CopyGuiCommand()) .WithSource(source) .WithDestination(destination); repository.Execute(command); }