diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-24 15:44:21 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-24 15:44:21 +0300 |
| commit | 496d83d940efe71ec7cbadd59c08804f4671c480 (patch) | |
| tree | e707449fca989b6e519b92033557a8a2374e5fcc /Software/Visual_Studio/Tango.Core | |
| parent | c5e790039126cfdb32fe8cf8fd90c39bc8eaf943 (diff) | |
| download | Tango-496d83d940efe71ec7cbadd59c08804f4671c480.tar.gz Tango-496d83d940efe71ec7cbadd59c08804f4671c480.zip | |
JobProgress Tester Utility for Vica.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs | 7 |
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)); } |
