Example #1
0
 /// <summary>
 /// Instantiates a new instance of the <see cref="TagHelperDescriptor"/> class with the given
 /// <paramref name="attributes"/>.
 /// </summary>
 /// <param name="prefix">
 /// Text used as a required prefix when matching HTML start and end tags in the Razor source to available
 /// tag helpers.
 /// </param>
 /// <param name="tagName">The tag name that the tag helper targets. '*' indicates a catch-all
 /// <see cref="TagHelperDescriptor"/> which applies to every HTML tag.</param>
 /// <param name="typeName">The full name of the tag helper class.</param>
 /// <param name="assemblyName">The name of the assembly containing the tag helper class.</param>
 /// <param name="attributes">
 /// The <see cref="TagHelperAttributeDescriptor"/>s to request from the HTML tag.
 /// </param>
 /// <param name="requiredAttributes">
 /// The attribute names required for the tag helper to target the HTML tag.
 /// </param>
 /// <param name="designTimeDescriptor">The <see cref="TagHelperDesignTimeDescriptor"/> that contains design
 /// time information about the tag helper.</param>
 public TagHelperDescriptor(
     string prefix,
     [NotNull] string tagName,
     [NotNull] string typeName,
     [NotNull] string assemblyName,
     [NotNull] IEnumerable <TagHelperAttributeDescriptor> attributes,
     [NotNull] IEnumerable <string> requiredAttributes,
     TagHelperDesignTimeDescriptor designTimeDescriptor)
 {
     Prefix               = prefix ?? string.Empty;
     TagName              = tagName;
     FullTagName          = Prefix + TagName;
     TypeName             = typeName;
     AssemblyName         = assemblyName;
     Attributes           = new List <TagHelperAttributeDescriptor>(attributes);
     RequiredAttributes   = new List <string>(requiredAttributes);
     DesignTimeDescriptor = designTimeDescriptor;
 }
 private static TagHelperDescriptor BuildTagHelperDescriptor(
     string tagName,
     string typeName,
     string assemblyName,
     IEnumerable<TagHelperAttributeDescriptor> attributeDescriptors,
     IEnumerable<string> requiredAttributes,
     IEnumerable<string> allowedChildren,
     TagStructure tagStructure,
     TagHelperDesignTimeDescriptor designTimeDescriptor)
 {
     return new TagHelperDescriptor
     {
         TagName = tagName,
         TypeName = typeName,
         AssemblyName = assemblyName,
         Attributes = attributeDescriptors,
         RequiredAttributes = requiredAttributes,
         AllowedChildren = allowedChildren,
         TagStructure = tagStructure,
         DesignTimeDescriptor = designTimeDescriptor
     };
 }
        private static TagHelperDescriptor BuildTagHelperDescriptor(
            string typeName,
            string assemblyName,
            IEnumerable<TagHelperAttributeDescriptor> attributeDescriptors,
            TargetElementAttribute targetElementAttribute,
            IEnumerable<string> allowedChildren,
            TagHelperDesignTimeDescriptor designTimeDescriptor)
        {
            var requiredAttributes = GetCommaSeparatedValues(targetElementAttribute.Attributes);

            return BuildTagHelperDescriptor(
                targetElementAttribute.Tag,
                typeName,
                assemblyName,
                attributeDescriptors,
                requiredAttributes,
                allowedChildren,
                targetElementAttribute.TagStructure,
                designTimeDescriptor);
        }
 private static TagHelperDescriptor BuildTagHelperDescriptor(
     string tagName,
     string typeName,
     string assemblyName,
     IEnumerable<TagHelperAttributeDescriptor> attributeDescriptors,
     IEnumerable<string> requiredAttributes,
     TagHelperDesignTimeDescriptor designTimeDescriptor)
 {
     return new TagHelperDescriptor(
         prefix: string.Empty,
         tagName: tagName,
         typeName: typeName,
         assemblyName: assemblyName,
         attributes: attributeDescriptors,
         requiredAttributes: requiredAttributes,
         designTimeDescriptor: designTimeDescriptor);
 }
Example #5
0
 /// <summary>
 /// Instantiates a new instance of the <see cref="TagHelperDescriptor"/> class with the given
 /// <paramref name="attributes"/>.
 /// </summary>
 /// <param name="prefix">
 /// Text used as a required prefix when matching HTML start and end tags in the Razor source to available
 /// tag helpers.
 /// </param>
 /// <param name="tagName">The tag name that the tag helper targets. '*' indicates a catch-all
 /// <see cref="TagHelperDescriptor"/> which applies to every HTML tag.</param>
 /// <param name="typeName">The full name of the tag helper class.</param>
 /// <param name="assemblyName">The name of the assembly containing the tag helper class.</param>
 /// <param name="attributes">
 /// The <see cref="TagHelperAttributeDescriptor"/>s to request from the HTML tag.
 /// </param>
 /// <param name="requiredAttributes">
 /// The attribute names required for the tag helper to target the HTML tag.
 /// </param>
 /// <param name="designTimeDescriptor">The <see cref="TagHelperDesignTimeDescriptor"/> that contains design
 /// time information about the tag helper.</param>
 public TagHelperDescriptor(
     string prefix,
     [NotNull] string tagName,
     [NotNull] string typeName,
     [NotNull] string assemblyName,
     [NotNull] IEnumerable<TagHelperAttributeDescriptor> attributes,
     [NotNull] IEnumerable<string> requiredAttributes,
     TagHelperDesignTimeDescriptor designTimeDescriptor)
 {
     Prefix = prefix ?? string.Empty;
     TagName = tagName;
     FullTagName = Prefix + TagName;
     TypeName = typeName;
     AssemblyName = assemblyName;
     Attributes = new List<TagHelperAttributeDescriptor>(attributes);
     RequiredAttributes = new List<string>(requiredAttributes);
     DesignTimeDescriptor = designTimeDescriptor;
 }