Exemplo n.º 1
0
        private static string _CreateBaseMessage(TARGET target, String message)
        {
            if (target == null)
            {
                return(message);
            }

            var targetTypeInfo = target.GetType().GetTypeInfo();

            var logicalIndexProp = targetTypeInfo.GetProperty("LogicalIndex");

            var logicalIndex = logicalIndexProp != null ? (int)logicalIndexProp.GetValue(target) : -1;

            if (logicalIndex >= 0)
            {
                return($"{targetTypeInfo.Name}[{logicalIndex}] {message}");
            }

            return($"{targetTypeInfo.Name} {message}");
        }
Exemplo n.º 2
0
 public ValidationContext GetContext(TARGET target)
 {
     return(new ValidationContext(this, target));
 }
Exemplo n.º 3
0
 internal ValidationContext(ValidationContext context, TARGET target)
 {
     _Root    = context._Root;
     _Mode    = context._Mode;
     _Current = target;
 }
Exemplo n.º 4
0
 internal LinkException(TARGET target, String message)
     : base(target, message)
 {
 }
Exemplo n.º 5
0
 internal SemanticException(TARGET target, String message)
     : base(target, message)
 {
 }
Exemplo n.º 6
0
 internal SchemaException(TARGET target, Newtonsoft.Json.JsonReaderException rex)
     : base(target, rex)
 {
 }
Exemplo n.º 7
0
 internal SchemaException(TARGET target, String message)
     : base(target, message)
 {
 }
Exemplo n.º 8
0
 public void AddError(TARGET target, String message)
 {
     _Exceptions.Add(new ModelException(target, message));
 }
Exemplo n.º 9
0
 internal ModelException(TARGET target, Exception ex)
     : base(_CreateBaseMessage(target, ex.Message), ex)
 {
     _Target = target;
 }
Exemplo n.º 10
0
 internal ModelException(TARGET target, String message)
     : base(_CreateBaseMessage(target, message))
 {
     _Target = target;
 }
Exemplo n.º 11
0
 public void UnsupportedExtensionError(TARGET target, String message)
 {
     AddLinkError(target, message);
 }
Exemplo n.º 12
0
 public void AddLinkError(TARGET target, String message)
 {
     _Exceptions.Add(new LinkException(target, message));
 }
Exemplo n.º 13
0
 public void AddDataError(TARGET target, String message)
 {
     _Exceptions.Add(new DataException(target, message));
 }
Exemplo n.º 14
0
 public void AddSemanticError(TARGET target, String message)
 {
     _Exceptions.Add(new SemanticException(target, message));
 }
Exemplo n.º 15
0
 public void InvalidJson(TARGET target, string message)
 {
     AddSchemaError(target, $"Invalid JSON data. Parser output: {message}");
 }
Exemplo n.º 16
0
 public ValidationContext(ValidationResult result, TARGET target)
 {
     _Result = result;
     _Target = target;
 }
Exemplo n.º 17
0
 public ValidationContext GetContext(TARGET target)
 {
     return(_Result.GetContext(target));
 }
Exemplo n.º 18
0
 internal SchemaException(TARGET target, System.Text.Json.JsonException rex)
     : base(target, rex)
 {
 }