GetTypes() public method

public GetTypes ( ) : List
return List
Beispiel #1
0
        private List <Type> InjectSignalParameters(object[] parameters)
        {
            var types         = signal.GetTypes();
            var injectedTypes = new List <Type>();

            foreach (var type in types)
            {
                var isFound = false;
                foreach (var parameter in parameters)
                {
                    if (parameter == null)
                    {
                        throw new InjectionException("Attempt to bind null value into Command: " + currentCommand);
                    }
                    if (type.IsInstanceOfType(parameter))
                    {
                        binder.Bind(type).ToInstance(parameter);
                        injectedTypes.Add(type);
                        isFound = true;
                    }
                }
                if (!isFound)
                {
                    throw new InjectionException("Cannot find value to inject into Command: " + currentCommand + " for type: " + type);
                }
            }
            return(injectedTypes);
        }