[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
sealed public class TestThisAttribute : ValidationAttribute
{
public TestThisAttribute()
{
NinjaScript.Log("TestThisAttribute::TestAttribute: constructor", LogLevel.Information);
}
public override bool RequiresValidationContext { get { return true; } }
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
NinjaScript.Log("TestThisAttribute::IsValid: called", LogLevel.Information);
return new ValidationResult("Input invalid");
}
}
[NinjaScriptProperty]
[TestThis]
[Display(ResourceType=typeof(Resource), Name="Test integer", GroupName="Test", Order=0)]
public int testInt { get; set; }
Any idea on what I need to do to make a custom ValidationAttribute work for a property in NinjaTrader 8?

Comment