simplify ApplicationArguments

This commit is contained in:
Holger Boerchers 2018-07-30 23:09:41 +02:00
parent aa70a24a26
commit 9c23948f38
2 changed files with 10 additions and 38 deletions

View File

@ -6,19 +6,15 @@ namespace KattekerCreator
public class ApplicationArguments
{
private string _changeLog;
private string _channel;
private string _outputDir;
private string _programFile;
private string _publishDir;
private string _version;
private string _filterAsString;
private string _outputDir;
[DisplayName("Program")]
[Description("Path to the program file")]
public string ProgramFile
{
get => _programFile;
set => SetPropertyIfNotDefault(ref _programFile, Path.GetFullPath(value));
set => _programFile = Path.GetFullPath(value);
}
[DisplayName("Changelog")]
@ -26,56 +22,32 @@ namespace KattekerCreator
public string ChangeLog
{
get => _changeLog;
set => SetPropertyIfNotDefault(ref _changeLog, Path.GetFullPath(value));
set => _changeLog = Path.GetFullPath(value);
}
[DisplayName("Channel")]
[Description("Channel of releasing.")]
public string Channel
{
get => _channel;
set => SetPropertyIfNotDefault(ref _channel, value);
}
public string Channel { get; set; }
[DisplayName("Out")]
[Description("Directory for the output")]
public string OutputDir
{
get => _outputDir;
set => SetPropertyIfNotDefault(ref _outputDir, value);
set => _outputDir = Path.GetFullPath(value);
}
[DisplayName("Publish")]
[Description("Path for output from the point of view of the application.")]
public string PublishDir
{
get => _publishDir;
set => SetPropertyIfNotDefault(ref _publishDir, value);
}
public string PublishDir { get; set; }
[DisplayName("Version")]
[Description("Override version number of the application.")]
public string Version
{
get => _version;
set => SetPropertyIfNotDefault(ref _version, value);
}
public string Version { get; set; }
[DisplayName("Filter")]
[Description("Filter parameter. Use minimatch pattern.")]
public string FilterAsString
{
get => _filterAsString;
set => SetPropertyIfNotDefault(ref _filterAsString, value);
}
private static bool SetPropertyIfNotDefault<T>(ref T field, T value)
{
if (Equals(value, field)) return false;
if (!Equals(field, default(T))) return false;
field = value;
return true;
}
public string FilterAsString { get; set; }
public string[] Filter => string.IsNullOrWhiteSpace(FilterAsString) ? new string[0] : FilterAsString.Split(';');
}

View File

@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: AssemblyVersion("1.1.2")]
[assembly: AssemblyFileVersion("1.1.2")]