PageRenderTime 36ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/Mercurial.Net/Gui/GuiVersionCommand.cs

#
C# | 44 lines | 20 code | 2 blank | 22 comment | 2 complexity | 530116461884ccd87bbc6d4bd3402287 MD5 | raw file
 1namespace 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
18        /// <summary>
19        /// This method should parse and store the appropriate execution result output
20        /// according to the type of data the command line client would return for
21        /// the command.
22        /// </summary>
23        /// <param name="exitCode">
24        /// The exit code from executing the command line client.
25        /// </param>
26        /// <param name="standardOutput">
27        /// The standard output from executing the command line client.
28        /// </param>
29        protected override void ParseStandardOutputForResults(int exitCode, string standardOutput)
30        {
31            if (exitCode == 0)
32                Result = standardOutput;
33        }
34
35        /// <summary>
36        /// Gets the result from the command line execution, as an appropriately typed value.
37        /// </summary>
38        public string Result
39        {
40            get;
41            private set;
42        }
43    }
44}