protected void CheckIfContainsProperty([NotNull] ComponentProcessorProperties properties, string property) { if (!properties.ContainsProperty(property)) { throw new InvalidOperationException($"{GetType().FullName} processor configuration needs '{property}' element in configuration specified."); } }
private void CheckIfOnlySupportedPropertiesWereSpecified([NotNull] ComponentProcessorProperties properties, string processorName) { var supportedPropertyName = new HashSet <string>(SupportedPropertyNames); foreach (var property in properties) { if (!supportedPropertyName.Contains(property.Key)) { throw new InvalidOperationException($"Not supported property '{property.Key}' of '{GetType().FullName}' configuration was specified for processor '{processorName}'."); } } }
protected override void LoadFromPropertiesInternal(ComponentProcessorProperties properties, TypeAliasResolver typeAliasResolver, string processorName) { }
protected abstract void LoadFromPropertiesInternal([NotNull] ComponentProcessorProperties properties, TypeAliasResolver typeAliasResolver, string processorName);
public void LoadFromProperties([NotNull] ComponentProcessorProperties properties, TypeAliasResolver typeAliasResolver, string processorName) { CheckIfOnlySupportedPropertiesWereSpecified(properties, processorName); LoadFromPropertiesInternal(properties, typeAliasResolver, processorName); }