From 496d83d940efe71ec7cbadd59c08804f4671c480 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 24 May 2020 15:44:21 +0300 Subject: JobProgress Tester Utility for Vica. --- Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Core') 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 @@ -47,6 +47,11 @@ namespace Tango.Core.DI private Dictionary _registeredTypes; private List>> _waitingRetrivals; + /// + /// Gets or sets a value indicating whether to throw an exception when a type is requested but not registered. + /// + public bool ThrowOnRequestedTypeNotFound { get; set; } = true; + /// /// Initializes a new instance of the class. /// @@ -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)); } -- cgit v1.3.1