PageRenderTime 24ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/Mercurial.Net/Gui/DiffGuiCommand.cs

#
C# | 125 lines | 55 code | 9 blank | 61 comment | 0 complexity | 7c9ad1269cffd8a5a9306cf0cd1afa9a MD5 | raw file
  1using System.ComponentModel;
  2using Mercurial.Attributes;
  3
  4namespace Mercurial.Gui
  5{
  6    /// <summary>
  7    /// Implements the TortoiseHg "vdiff" command:
  8    /// Launch the visual diff tool.
  9    /// </summary>
 10    public sealed class DiffGuiCommand : FilesBasedGuiCommandBase<DiffGuiCommand>
 11    {
 12        /// <summary>
 13        /// This is the backing field for the <see cref="BundleFile"/> property.
 14        /// </summary>
 15        private string _BundleFile = string.Empty;
 16
 17        /// <summary>
 18        /// Initializes a new instance of the <see cref="DiffGuiCommand"/> class.
 19        /// </summary>
 20        public DiffGuiCommand()
 21            : base("vdiff")
 22        {
 23            // Do nothing here
 24        }
 25
 26        /// <summary>
 27        /// Gets or sets the bundle file to preview.
 28        /// </summary>
 29        [NullableArgument(NonNullOption = "--bundle")]
 30        [DefaultValue("")]
 31        public string BundleFile
 32        {
 33            get
 34            {
 35                return _BundleFile;
 36            }
 37
 38            set
 39            {
 40                _BundleFile = value;
 41            }
 42        }
 43
 44        /// <summary>
 45        /// Sets the <see cref="BundleFile"/> property to the specified value and
 46        /// returns this <see cref="DiffGuiCommand"/> instance.
 47        /// </summary>
 48        /// <param name="value">
 49        /// The new value for the <see cref="BundleFile"/> property.
 50        /// </param>
 51        /// <returns>
 52        /// This <see cref="DiffGuiCommand"/> instance.
 53        /// </returns>
 54        /// <remarks>
 55        /// This method is part of the fluent interface.
 56        /// </remarks>
 57        public DiffGuiCommand WithBundleFile(string value)
 58        {
 59            BundleFile = value;
 60            return this;
 61        }
 62
 63        /// <summary>
 64        /// Gets or sets the specific changeset to view in the diff tool.
 65        /// </summary>
 66        [NullableArgument(NonNullOption = "--change")]
 67        [DefaultValue(null)]
 68        public RevSpec Changeset
 69        {
 70            get;
 71            set;
 72        }
 73
 74        /// <summary>
 75        /// Sets the <see cref="Changeset"/> property to the specified value and
 76        /// returns this <see cref="DiffGuiCommand"/> instance.
 77        /// </summary>
 78        /// <param name="value">
 79        /// The new value for the <see cref="Changeset"/> property.
 80        /// </param>
 81        /// <returns>
 82        /// This <see cref="DiffGuiCommand"/> instance.
 83        /// </returns>
 84        /// <remarks>
 85        /// This method is part of the fluent interface.
 86        /// </remarks>
 87        public DiffGuiCommand WithChangeset(RevSpec value)
 88        {
 89            Changeset = value;
 90            return this;
 91        }
 92
 93        /// <summary>
 94        /// Gets or sets the revision <see cref="RevSpec"/> that identifies the revision or the
 95        /// revision range to view a diff of.
 96        /// Default value is <c>null</c>.
 97        /// </summary>
 98        [NullableArgument(NonNullOption = "--rev")]
 99        [DefaultValue(null)]
100        public RevSpec Revisions
101        {
102            get;
103            set;
104        }
105
106        /// <summary>
107        /// Sets the <see cref="Revisions"/> property to the specified value and
108        /// returns this <see cref="DiffGuiCommand"/> instance.
109        /// </summary>
110        /// <param name="value">
111        /// The new value for the <see cref="Revisions"/> property.
112        /// </param>
113        /// <returns>
114        /// This <see cref="DiffGuiCommand"/> instance.
115        /// </returns>
116        /// <remarks>
117        /// This method is part of the fluent interface.
118        /// </remarks>
119        public DiffGuiCommand WithRevisions(RevSpec value)
120        {
121            Revisions = value;
122            return this;
123        }
124    }
125}