예제 #1
0
        /// <summary>
        /// Initializes a repository remotely, through a server which supports such functionality.
        /// </summary>
        /// <param name="command">
        /// The options to the init method.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// <para><paramref name="command"/> is <c>null</c>.</para>
        /// </exception>
        public static void RemoteInit(RemoteInitCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            NonPersistentClient.Execute(command);
        }
예제 #2
0
        /// <summary>
        /// Initializes a repository remotely, through a server which supports such functionality.
        /// </summary>
        /// <param name="location">
        /// The url of the repository to initialize remotely.
        /// </param>
        /// <param name="command">
        /// Any extra options to the init method, or <c>null</c> for default options.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// <para><paramref name="location"/> is <c>null</c> or empty.</para>
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// <para><see cref="RemoteInitCommand.Location"/> cannot be set before calling this method.</para>
        /// </exception>
        public static void RemoteInit(string location, RemoteInitCommand command = null)
        {
            if (StringEx.IsNullOrWhiteSpace(location))
            {
                throw new ArgumentNullException("location");
            }
            if (command != null && !StringEx.IsNullOrWhiteSpace(command.Location))
            {
                throw new ArgumentException("RemoteInitCommand.Location cannot be set before calling this method", "command");
            }

            command = (command ?? new RemoteInitCommand())
                      .WithLocation(location);

            NonPersistentClient.Execute(command);
        }