PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/Mercurial.Net/PersistentClientFactory.cs

#
C# | 29 lines | 11 code | 1 blank | 17 comment | 0 complexity | 98e01239aafc7eef3e5c40bdd35532e1 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System;
  2. namespace Mercurial
  3. {
  4. /// <summary>
  5. /// This class implements <see cref="IClientFactory"/> by always constructing objects
  6. /// of type <see cref="PersistentClient"/>.
  7. /// </summary>
  8. public sealed class PersistentClientFactory : IClientFactory
  9. {
  10. /// <summary>
  11. /// Creates a new <see cref="IClient"/> object for use by the <see cref="Repository"/>.
  12. /// </summary>
  13. /// <param name="repositoryPath">
  14. /// The path to the repository to manage by the <see cref="IClient"/> and the
  15. /// <see cref="Repository"/>.
  16. /// </param>
  17. /// <returns>
  18. /// The <see cref="IClient"/> implementation to use.
  19. /// </returns>
  20. /// <exception cref="ArgumentNullException">
  21. /// <para><paramref name="repositoryPath"/> is <c>null</c> or empty.</para>
  22. /// </exception>
  23. public IClient CreateClient(string repositoryPath)
  24. {
  25. return new PersistentClient(repositoryPath);
  26. }
  27. }
  28. }