mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
36 lines
971 B
C#
36 lines
971 B
C#
|
namespace TriInspector
|
|||
|
{
|
|||
|
public readonly struct TriValidationResult
|
|||
|
{
|
|||
|
public static TriValidationResult Valid => new TriValidationResult(true, null, TriMessageType.None);
|
|||
|
|
|||
|
private TriValidationResult(bool valid, string message, TriMessageType messageType)
|
|||
|
{
|
|||
|
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,
|
|||
|
}
|
|||
|
}
|