2022-01-18 12:19:15 -05:00
|
|
|
|
namespace TriInspector
|
|
|
|
|
{
|
|
|
|
|
public readonly struct TriValidationResult
|
|
|
|
|
{
|
|
|
|
|
public static TriValidationResult Valid => new TriValidationResult(true, null, TriMessageType.None);
|
|
|
|
|
|
2022-05-19 10:31:43 -04:00
|
|
|
|
public TriValidationResult(bool valid, string message, TriMessageType messageType)
|
2022-01-18 12:19:15 -05:00
|
|
|
|
{
|
|
|
|
|
IsValid = valid;
|
|
|
|
|
Message = message;
|
|
|
|
|
MessageType = messageType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsValid { get; }
|
|
|
|
|
public string Message { get; }
|
|
|
|
|
public TriMessageType MessageType { get; }
|
|
|
|
|
|
|
|
|
|
public static TriValidationResult Error(string error)
|
|
|
|
|
{
|
|
|
|
|
return new TriValidationResult(false, error, TriMessageType.Error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static TriValidationResult Warning(string error)
|
|
|
|
|
{
|
|
|
|
|
return new TriValidationResult(false, error, TriMessageType.Warning);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum TriMessageType
|
|
|
|
|
{
|
|
|
|
|
None,
|
|
|
|
|
Info,
|
|
|
|
|
Warning,
|
|
|
|
|
Error,
|
|
|
|
|
}
|
|
|
|
|
}
|