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

/Mercurial.Net/Gui/LogGuiCommand.cs

#
C# | 63 lines | 31 code | 5 blank | 27 comment | 0 complexity | 06df19b77db284f334166a05ba1b2aec MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System.ComponentModel;
  2. using Mercurial.Attributes;
  3. namespace Mercurial.Gui
  4. {
  5. /// <summary>
  6. /// Implements the TortoiseHg "log" command (<see href="http://tortoisehg.bitbucket.org/manual/2.0/workbench.html#from-command-line"/>):
  7. /// Repository explorer (changelog viewer.)
  8. /// </summary>
  9. public sealed class LogGuiCommand : GuiCommandBase<LogGuiCommand>
  10. {
  11. /// <summary>
  12. /// This is the backing field for the <see cref="File"/> property.
  13. /// </summary>
  14. private string _File = string.Empty;
  15. /// <summary>
  16. /// Initializes a new instance of the <see cref="LogGuiCommand"/> class.
  17. /// </summary>
  18. public LogGuiCommand()
  19. : base("log")
  20. {
  21. // Do nothing here
  22. }
  23. /// <summary>
  24. /// Gets or sets which file to show the log for.
  25. /// </summary>
  26. [NullableArgument]
  27. [DefaultValue("")]
  28. public string File
  29. {
  30. get
  31. {
  32. return _File;
  33. }
  34. set
  35. {
  36. _File = (value ?? string.Empty).Trim();
  37. }
  38. }
  39. /// <summary>
  40. /// Sets the <see cref="File"/> property to the specified value and
  41. /// returns this <see cref="LogGuiCommand"/> instance.
  42. /// </summary>
  43. /// <param name="value">
  44. /// The new value for the <see cref="File"/> property.
  45. /// </param>
  46. /// <returns>
  47. /// This <see cref="LogGuiCommand"/> instance.
  48. /// </returns>
  49. /// <remarks>
  50. /// This method is part of the fluent interface.
  51. /// </remarks>
  52. public LogGuiCommand WithFile(string value)
  53. {
  54. File = value;
  55. return this;
  56. }
  57. }
  58. }