public ComponentInfo Build(MethodInfo componentMethod, ComponentDescriptionImpl componentDescription)
        {
            PersistentConfig config  = (PersistentConfig)componentMethod.GetCustomAttributes(typeof(PersistentConfig), false)[0];
            string           keyName = config.value;

            if (keyName.Length == 0)
            {
                keyName = componentDescription.FieldName;
            }
            return(new ConfigComponentInfo(keyName, config.configOptional));
        }
        private void AddComponentInfoFromMethod(MethodInfo method)
        {
            ComponentDescriptionImpl impl = new ComponentDescriptionImpl(method);

            impl.CollectInfo(this.templateRegistry.ComponentInfoBuilders);
            if (this.ownComponentDescriptions.ContainsKey(impl.ComponentType))
            {
                throw new DuplicateComponentOnTemplateException(this, impl.ComponentType);
            }
            this.ownComponentDescriptions[impl.ComponentType] = impl;
        }
 public ComponentInfo Build(MethodInfo componentMethod, ComponentDescriptionImpl componentDescription) =>
 Activator.CreateInstance <T>();