public void Initialise(Type decoratedType) { _targetType = decoratedType; if (_targetType.BaseType != null) { _basis = _targetType.BaseType.GetCodeFirstAttribute <NodePickerConfigAttribute>(); } Init(decoratedType.Name); }
public void Initialise(PropertyInfo propertyTarget) { _targetType = propertyTarget.PropertyType; if (_targetType.IsGenericType && _targetType.Inherits <DataTypes.NodePicker>()) { _targetType = _targetType.GetGenericArguments().First(); } else if (_targetType.IsGenericType && _targetType.GetGenericTypeDefinition() == typeof(IEnumerable <>)) { _targetType = _targetType.GenericTypeArguments.First(); } _basis = _targetType.GetCodeFirstAttribute <NodePickerConfigAttribute>(); Init(propertyTarget.DeclaringType.Name + "." + propertyTarget.Name); }