Exemple #1
0
        /// <summary>
        /// Merges attributes of <see cref="HtmlAttributes"/> and <see cref="LinkHtmlAttributes"/> into one combined dictionary.
        /// </summary>
        /// <returns>New dictionary instance with combined attributes.</returns>
        public AttributeDictionary GetCombinedAttributes()
        {
            if (HtmlAttributes == null && LinkHtmlAttributes == null)
            {
                return(null);
            }

            var combined = new AttributeDictionary();

            combined.AddRange(HtmlAttributes ?? LinkHtmlAttributes);

            if (HtmlAttributes != null && LinkHtmlAttributes != null)
            {
                combined.Merge(LinkHtmlAttributes);
            }

            return(combined);
        }