initial files

This commit is contained in:
2020-09-04 21:19:24 -04:00
parent 7943589101
commit 2aa9ce3eb7
28 changed files with 3246 additions and 0 deletions

View File

@ -0,0 +1,28 @@
using System;
using System.Reflection;
namespace BinaryDad.Extensions
{
[Serializable]
public class DataPropertyConversionException : Exception
{
public object Item { get; private set; }
public object Value { get; private set; }
public PropertyInfo Property { get; private set; }
/// <summary>
/// Represents an exception that occurs upon setting the value of a property on an object through type conversion
/// </summary>
/// <param name="item">The parent object containing the property</param>
/// <param name="property">The property info instance of the property</param>
/// <param name="value">The value being set</param>
/// <param name="ex">The original exception (assigned as inner)</param>
public DataPropertyConversionException(object item, PropertyInfo property, object value, Exception ex)
: base($"Unable to assign value {value ?? "null"} ({value?.GetType().Name}) to property {item?.GetType().Name}.{property?.Name} ({property?.PropertyType.Name})", ex)
{
Value = value;
Item = item;
Property = property;
}
}
}

View File

@ -0,0 +1,14 @@
using System;
namespace BinaryDad.Extensions
{
[Serializable]
public class MaxRecursionException : Exception
{
public MaxRecursionException() { }
public MaxRecursionException(string message) : base(message) { }
public MaxRecursionException(string message, Exception innerException) : base(message, innerException) { }
}
}