示例#1
0
 public void BeginAddHtmlAttributeValues(
     TagHelperExecutionContext executionContext,
     string attributeName,
     int attributeValuesCount,
     HtmlAttributeValueStyle attributeValueStyle)
 {
 }
示例#2
0
 public TagHelperAttributeKey(string name, string value, bool unBoundAttribute, HtmlAttributeValueStyle valueStyle)
 {
     Name             = name;
     Value            = value;
     UnBoundAttribute = unBoundAttribute;
     ValueStyle       = valueStyle;
 }
示例#3
0
            public TagHelperAttributeInfo(TagHelperExecutionContext tagHelperExecutionContext, string name, int attributeValuesCount, HtmlAttributeValueStyle attributeValueStyle)
            {
                ExecutionContext     = tagHelperExecutionContext;
                Name                 = name;
                AttributeValuesCount = attributeValuesCount;
                AttributeValueStyle  = attributeValueStyle;

                Suppressed = false;
            }
示例#4
0
        /// <summary>
        /// Instantiates a new instance of <see cref="TagHelperAttribute"/> with the specified <paramref name="name"/>,
        /// <paramref name="value"/> and <paramref name="valueStyle"/>.
        /// </summary>
        /// <param name="name">The <see cref="Name"/> of the new instance.</param>
        /// <param name="value">The <see cref="Value"/> of the new instance.</param>
        /// <param name="valueStyle">The <see cref="ValueStyle"/> of the new instance.</param>
        /// <remarks>If <paramref name="valueStyle"/> is <see cref="HtmlAttributeValueStyle.Minimized"/>,
        /// <paramref name="value"/> is ignored when this instance is rendered.</remarks>
        public TagHelperAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name       = name;
            Value      = value;
            ValueStyle = valueStyle;
        }
        /// <summary>
        /// Tracks the <see cref="ITagHelper"/> bound attribute.
        /// </summary>
        /// <param name="name">The bound attribute name.</param>
        /// <param name="value">The attribute value.</param>
        /// <param name="valueStyle">The value style of the attribute.</param>
        public void AddTagHelperAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            var attribute = new TagHelperAttribute(name, value, valueStyle);

            _allAttributes.Add(attribute);
        }
示例#6
0
        /// <summary>
        /// Instantiates a new instance of <see cref="TagHelperAttribute"/> with the specified <paramref name="name"/>,
        /// <paramref name="value"/> and <paramref name="valueStyle"/>.
        /// </summary>
        /// <param name="name">The <see cref="Name"/> of the new instance.</param>
        /// <param name="value">The <see cref="Value"/> of the new instance.</param>
        /// <param name="valueStyle">The <see cref="ValueStyle"/> of the new instance.</param>
        /// <remarks>If <paramref name="valueStyle"/> is <see cref="HtmlAttributeValueStyle.Minimized"/>,
        /// <paramref name="value"/> is ignored when this instance is rendered.</remarks>
        public TagHelperAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name = name;
            Value = value;
            ValueStyle = valueStyle;
        }
 public void BeginAddHtmlAttributeValues(
     TagHelperExecutionContext executionContext,
     string attributeName,
     int attributeValuesCount,
     HtmlAttributeValueStyle attributeValueStyle)
 {
     _tagHelperAttributeInfo = new TagHelperAttributeInfo(
         executionContext,
         attributeName,
         attributeValuesCount,
         attributeValueStyle);
 }
示例#8
0
        private void WriteVersionedSrc(
            string srcName,
            string srcValue,
            HtmlAttributeValueStyle valueStyle,
            TextWriter writer)
        {
            srcValue = GetVersionedSrc(srcValue);

            writer.Write(' ');
            var attribute = new TagHelperAttribute(srcName, srcValue, valueStyle);

            attribute.WriteTo(writer, HtmlEncoder);
        }
示例#9
0
        private void AppendVersionedSrc(
            string srcName,
            string srcValue,
            HtmlAttributeValueStyle valueStyle,
            IHtmlContentBuilder builder)
        {
            srcValue = GetVersionedSrc(srcValue);

            builder.AppendHtml(" ");
            var attribute = new TagHelperAttribute(srcName, srcValue, valueStyle);

            attribute.CopyTo(builder);
        }
示例#10
0
        private static string GetAttributeValueSuffix(HtmlAttributeValueStyle valueStyle)
        {
            switch (valueStyle)
            {
            case HtmlAttributeValueStyle.DoubleQuotes:
                return("\"");

            case HtmlAttributeValueStyle.SingleQuotes:
                return("'");
            }

            return(null);
        }
示例#11
0
        /// <summary>
        /// Gets the quote character.
        /// </summary>
        protected static string GetQuote(HtmlAttributeValueStyle style)
        {
            switch (style)
            {
            case HtmlAttributeValueStyle.DoubleQuotes:
                return("\"");

            case HtmlAttributeValueStyle.SingleQuotes:
                return("'");
            }

            return(string.Empty);
        }
 public void AddTagHelperAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
 {
 }
 public TagHelperAttributeTracker(string name, Chunk value, HtmlAttributeValueStyle valueStyle)
 {
     Name       = name;
     Value      = value;
     ValueStyle = valueStyle;
 }
 public TagHelperAttributeNode(string name, SyntaxTreeNode value, HtmlAttributeValueStyle valueStyle)
 {
     Name       = name;
     Value      = value;
     ValueStyle = valueStyle;
 }
示例#15
0
 public TagAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
     : base(name, value, valueStyle)
 {
 }
示例#16
0
        private static string GetAttributeValueSuffix(HtmlAttributeValueStyle valueStyle)
        {
            switch (valueStyle)
            {
                case HtmlAttributeValueStyle.DoubleQuotes:
                    return "\"";
                case HtmlAttributeValueStyle.SingleQuotes:
                    return "'";
            }

            return null;
        }