mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
616 B
19 lines
616 B
using System; |
|
using System.ComponentModel.DataAnnotations; |
|
|
|
namespace ICSharpCode.Decompiler.Console |
|
{ |
|
[AttributeUsage(AttributeTargets.Class)] |
|
public class ProjectOptionRequiresOutputDirectoryValidationAttribute : ValidationAttribute |
|
{ |
|
protected override ValidationResult IsValid(object value, ValidationContext context) |
|
{ |
|
if (value is ILSpyCmdProgram obj) { |
|
if (obj.CreateCompilableProjectFlag && String.IsNullOrEmpty(obj.OutputDirectory)) { |
|
return new ValidationResult("--project cannot be used unless --outputdir is also specified"); |
|
} |
|
} |
|
return ValidationResult.Success; |
|
} |
|
} |
|
}
|
|
|