public void Execute(IBuildChain buildChain, object instance, ParameterInfo parameterInfo) { }
/// <summary> /// Returns whether the specified type and name matches this generator. /// </summary> /// <param name="buildChain">The build chain.</param> /// <param name="type">The type of value to generate.</param> /// <param name="referenceName">The name of the item to generate.</param> /// <returns><c>true</c> if the type matches this generator; otherwise <c>false</c>.</returns> protected abstract bool IsMatch(IBuildChain buildChain, Type type, string?referenceName);
public bool RunIsMatch(Type type, string referenceName, IBuildChain buildChain) { return(IsMatch(buildChain, type, referenceName)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="buildConfiguration" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="buildChain" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="type" /> parameter is <c>null</c>.</exception> public IBuildCapability?GetBuildCapability(IBuildConfiguration buildConfiguration, IBuildChain buildChain, Type type) { buildConfiguration = buildConfiguration ?? throw new ArgumentNullException(nameof(buildConfiguration)); buildChain = buildChain ?? throw new ArgumentNullException(nameof(buildChain)); type = type ?? throw new ArgumentNullException(nameof(type)); return(GetBuildCapability(x => x.IsMatch(type), buildConfiguration)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="buildConfiguration" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="buildChain" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="propertyInfo" /> parameter is <c>null</c>.</exception> public IBuildCapability?GetBuildCapability(IBuildConfiguration buildConfiguration, IBuildChain buildChain, PropertyInfo propertyInfo) { buildConfiguration = buildConfiguration ?? throw new ArgumentNullException(nameof(buildConfiguration)); buildChain = buildChain ?? throw new ArgumentNullException(nameof(buildChain)); propertyInfo = propertyInfo ?? throw new ArgumentNullException(nameof(propertyInfo)); return(GetBuildCapability(x => x.IsMatch(propertyInfo), buildConfiguration)); }
public bool RunCanCreate(IBuildConfiguration configuration, IBuildChain buildChain, Type type, string referenceName) { return(base.CanCreate(configuration, buildChain, type, referenceName)); }
protected override bool CanCreate(IBuildConfiguration configuration, IBuildChain buildChain, Type type, string?referenceName) { return(false); }
protected override bool IsMatch(IBuildChain buildChain, Type type, string?referenceName) { return(type == typeof(SemVerChangeType)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="buildChain" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="buildConfiguration" /> parameter is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">The <paramref name="parameterInfo" /> parameter is <c>null</c>.</exception> public IBuildCapability?GetBuildCapability(IBuildConfiguration buildConfiguration, IBuildChain buildChain, ParameterInfo parameterInfo) { buildConfiguration = buildConfiguration ?? throw new ArgumentNullException(nameof(buildConfiguration)); buildChain = buildChain ?? throw new ArgumentNullException(nameof(buildChain)); parameterInfo = parameterInfo ?? throw new ArgumentNullException(nameof(parameterInfo)); return(GetBuildCapability( x => x.CanCreate(buildConfiguration, buildChain, parameterInfo), x => x.CanPopulate(buildConfiguration, buildChain, parameterInfo), buildConfiguration)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="propertyInfo" /> parameter is <c>null</c>.</exception> public bool CanPopulate(IBuildConfiguration configuration, IBuildChain buildChain, PropertyInfo propertyInfo) { propertyInfo = propertyInfo ?? throw new ArgumentNullException(nameof(propertyInfo)); return(CanPopulate(configuration, buildChain, propertyInfo.PropertyType, propertyInfo.Name)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="parameterInfo" /> parameter is <c>null</c>.</exception> public bool CanPopulate(IBuildConfiguration configuration, IBuildChain buildChain, ParameterInfo parameterInfo) { parameterInfo = parameterInfo ?? throw new ArgumentNullException(nameof(parameterInfo)); return(CanPopulate(configuration, buildChain, parameterInfo.ParameterType, parameterInfo.Name)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="type" /> parameter is <c>null</c>.</exception> public bool CanPopulate(IBuildConfiguration configuration, IBuildChain buildChain, Type type) { return(CanPopulate(configuration, buildChain, type, null)); }
/// <inheritdoc /> /// <exception cref="ArgumentNullException">The <paramref name="type" /> parameter is <c>null</c>.</exception> protected override bool CanCreate(IBuildConfiguration configuration, IBuildChain buildChain, Type type, string?referenceName) { // Creating using this creator has the same rules for populate as it does for create return(CanPopulate(configuration, buildChain, type, referenceName)); }
protected override bool IsMatch(IBuildChain buildChain, Type type, string?referenceName) { return(false); }