private void failIf(bool condition, string message, InjectionExceptionType type, Type t, object name) { failIf(condition, message, type, t, name, null); }
private void failIf(bool condition, string message, InjectionExceptionType type, Type t, object name, object target) { if (condition) { message += "\n\t\ttarget: " + target; message += "\n\t\ttype: " + t; message += "\n\t\tname: " + name; throw new InjectionException(message, type); } }
private void failIf(bool condition, string message, InjectionExceptionType type, Type t, object name, object target, PropertyInfo propertyInfo) { if (condition) { if (propertyInfo != null) { message += "\n\t\ttarget property: " + propertyInfo.Name; } failIf(true, message, type, t, name, target); } }
private void failIf(bool condition, string message, InjectionExceptionType type, Type t, object name, object target, IInjectionBinder binder) { if (condition) { message += "\n\ttarget: " + target; message += "\n\ttype: " + t; message += "\n\tname: " + name; if (binder != null) { message += "\n\tbinder: " + binder.GetBinderName(); } throw new InjectionException(message, type); } }
/// Constructs an InjectionException with a message and InjectionExceptionType public InjectionException(string message, InjectionExceptionType exceptionType) : base(message) { type = exceptionType; }
private void FailIf(bool condition, string message, InjectionExceptionType type) { FailIf(condition, message, type, null, null, null); }
private void failIf(bool condition, string message, InjectionExceptionType type, Type t, object name, object target, PropertyInfo propertyInfo) { if (condition) { if (propertyInfo != null) { message += "\n\t\ttarget property: " + propertyInfo.Name; } failIf (true, message, type, t, name, target); } }
public InjectionException(InjectionExceptionType type) : base(type.ToString()) { }
public InjectionException(InjectionExceptionType type, object data1, object data2) : base($"{type} [{data1}] [{data2}]") { }
public InjectionException(InjectionExceptionType type, object data) : base($"{type} [{data}]") { }