83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
|
|
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;
|
|
|
|
[DisplayName("Program")]
|
|
[Description("Path to the program file")]
|
|
public string ProgramFile
|
|
{
|
|
get => _programFile;
|
|
set => SetPropertyIfNotDefault(ref _programFile, Path.GetFullPath(value));
|
|
}
|
|
|
|
[DisplayName("Changelog")]
|
|
[Description("Path of the changelog file")]
|
|
public string ChangeLog
|
|
{
|
|
get => _changeLog;
|
|
set => SetPropertyIfNotDefault(ref _changeLog, Path.GetFullPath(value));
|
|
}
|
|
|
|
[DisplayName("Channel")]
|
|
[Description("Channel of releasing.")]
|
|
public string Channel
|
|
{
|
|
get => _channel;
|
|
set => SetPropertyIfNotDefault(ref _channel, value);
|
|
}
|
|
|
|
[DisplayName("Out")]
|
|
[Description("Directory for the output")]
|
|
public string OutputDir
|
|
{
|
|
get => _outputDir;
|
|
set => SetPropertyIfNotDefault(ref _outputDir, 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);
|
|
}
|
|
|
|
[DisplayName("Version")]
|
|
[Description("Override version number of the application.")]
|
|
public string Version
|
|
{
|
|
get => _version;
|
|
set => SetPropertyIfNotDefault(ref _version, value);
|
|
}
|
|
|
|
[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[] Filter => string.IsNullOrWhiteSpace(FilterAsString) ? new string[0] : FilterAsString.Split(';');
|
|
}
|
|
} |