aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
-rw-r--r--Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs b/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs
index 9ddf588f0..19e1e91bc 100644
--- a/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs
+++ b/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs
@@ -48,6 +48,11 @@ namespace Tango.Core.DI
private List<Tuple<Type, Action<Object>>> _waitingRetrivals;
/// <summary>
+ /// Gets or sets a value indicating whether to throw an exception when a type is requested but not registered.
+ /// </summary>
+ public bool ThrowOnRequestedTypeNotFound { get; set; } = true;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="TangoIOC"/> class.
/// </summary>
public TangoIOC()
@@ -200,7 +205,7 @@ namespace Tango.Core.DI
return registeredType.Instance;
}
- if (!DesignMode)
+ if (!DesignMode && ThrowOnRequestedTypeNotFound)
{
throw new InvalidOperationException(String.Format("Requested type '{0}' could not be found.", type.Name));
}