PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/Mercurial.Net/Gui/GuiVersionCommand.cs

#
C# | 44 lines | 20 code | 2 blank | 22 comment | 2 complexity | 530116461884ccd87bbc6d4bd3402287 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. namespace Mercurial.Gui
  2. {
  3. /// <summary>
  4. /// Implements the TortoiseHg "version" command:
  5. /// Retrieve the version text from the TortoiseHg client.
  6. /// </summary>
  7. public sealed class GuiVersionCommand : GuiCommandBase<GuiVersionCommand>, IMercurialCommand<string>
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="GuiVersionCommand"/> class.
  11. /// </summary>
  12. public GuiVersionCommand()
  13. : base("version")
  14. {
  15. // Do nothing here
  16. }
  17. /// <summary>
  18. /// This method should parse and store the appropriate execution result output
  19. /// according to the type of data the command line client would return for
  20. /// the command.
  21. /// </summary>
  22. /// <param name="exitCode">
  23. /// The exit code from executing the command line client.
  24. /// </param>
  25. /// <param name="standardOutput">
  26. /// The standard output from executing the command line client.
  27. /// </param>
  28. protected override void ParseStandardOutputForResults(int exitCode, string standardOutput)
  29. {
  30. if (exitCode == 0)
  31. Result = standardOutput;
  32. }
  33. /// <summary>
  34. /// Gets the result from the command line execution, as an appropriately typed value.
  35. /// </summary>
  36. public string Result
  37. {
  38. get;
  39. private set;
  40. }
  41. }
  42. }