Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0bd8d089 authored by Harald Martini's avatar Harald Martini
Browse files

added fallback parameter

parent e6c34be1
No related branches found
No related tags found
No related merge requests found
......@@ -41,22 +41,32 @@ namespace TUGraz.VectoCore.Utils.Ninject
/// Constructor for CombineArgumentsToNameInstanceProvider
/// </summary>
public CombineArgumentsToNameInstanceProvider(params MethodSettings[] settings)
public CombineArgumentsToNameInstanceProvider(params MethodSettings[] settings) : this(false, settings)
{
if (settings != null && settings.Any(s => s.methods == null)) {
}
public CombineArgumentsToNameInstanceProvider(bool fallback, params MethodSettings[] settings)
{
Fallback = fallback;
if (settings != null && settings.Any(s => s.methods == null))
{
throw new ArgumentException($"At least one method has to be specified in the MethodSetting");
}
if (settings != null) {
foreach (var setting in settings) {
foreach (var method in setting.methods) {
if (settings != null)
{
foreach (var setting in settings)
{
foreach (var method in setting.methods)
{
_methodSettings.Add(method, setting);
}
}
}
}
}
#region Overrides of StandardInstanceProvider
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment