예제 #1
0
 internal ModelException(JsonSerializable target, String message, Action fix, String fixDesc)
     : base(message)
 {
     _Target                 = target;
     _ProposedFix            = fix;
     _ProposedFixDescription = fixDesc;
 }
예제 #2
0
        private static string _CreateBaseMessage(JsonSerializable 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}");
        }
예제 #3
0
 internal UnsupportedExtensionException(JsonSerializable target, String message, Action fix, String fixDesc)
     : base(target, message, fix, fixDesc)
 {
 }
예제 #4
0
 internal UnsupportedExtensionException(JsonSerializable target, String message)
     : base(target, message)
 {
 }
예제 #5
0
 internal ModelException(JsonSerializable target, String message)
     : base(_CreateBaseMessage(target, message))
 {
     _Target = target;
 }