Fix EmptyBinder not identifying inheritance.
This commit is contained in:
@@ -33,12 +33,12 @@ namespace Cryville.Common {
|
||||
public override object ChangeType(object value, Type type, CultureInfo culture) {
|
||||
if (value == null)
|
||||
return null;
|
||||
else if (type == value.GetType())
|
||||
else if (type.IsAssignableFrom(value.GetType()))
|
||||
return value;
|
||||
else if (type.IsEnum && value is string) {
|
||||
return Enum.Parse(type, (string)value);
|
||||
}
|
||||
throw new InvalidCastException();
|
||||
throw new InvalidCastException(string.Format("Cannot cast {0} to {1}", value.GetType(), type));
|
||||
}
|
||||
|
||||
public override void ReorderArgumentArray(ref object[] args, object state) {
|
||||
|
Reference in New Issue
Block a user