Ejemplo n.º 1
0
        public void SetValue(Type type, object value, CannotFindProperty cannotFind)
        {
            string name = _plugin.FindArgumentNameForType(type, cannotFind);

            if (name != null)
            {
                SetValue(name, value);
            }
        }
Ejemplo n.º 2
0
        public string FindArgumentNameForType(Type type, CannotFindProperty cannotFind)
        {
            string returnValue =
                _constructor.FindFirstConstructorArgumentOfType(type) ??
                _setters.FindFirstWriteablePropertyOfType(type);

            if (returnValue == null && cannotFind == CannotFindProperty.ThrowException)
            {
                throw new StructureMapException(302, type.FullName, _pluggedType.FullName);
            }

            return(returnValue);
        }