src/Markdig/Renderers/Html/HtmlAttributes.cs
/// <summary>
/// Copies/merge the values from this instance to the specified <see cref="HtmlAttributes"/> instance.
/// </summary>
/// <param name="htmlAttributes">The HTML attributes.</param>
/// <param name="mergeIdAndProperties">If set to <c>true</c> it will merge properties to the target htmlAttributes. Default is <c>false</c></param>
/// <param name="shared">If set to <c>true</c> it will try to share Classes and Properties if destination don't have them, otherwise it will make a copy. Default is <c>true</c></param>
/// <exception cref="ArgumentNullException"></exception>
Copies/merge the values from this instance to the specified  instance.
Copies / merge the values from this instance to the specified instance .
public void CopyTo(HtmlAttributes htmlAttributes, bool mergeIdAndProperties = false, bool shared = true)
        {
            if (htmlAttributes is null) ThrowHelper.ArgumentNullException(nameof(htmlAttributes));
            if (!mergeIdAndProperties || Id != null)
            {
                htmlAttributes.Id = Id;
            }
            if (htmlAttributes.Classes is null)
            {
                htmlAttributes.Classes = shared ? Classes : Classes != null ? new (Classes) : null;
            }
            else if (Classes != null)
            {
                htmlAttributes.Classes.AddRange(Classes);
            }
            if (htmlAttributes.Properties is null)
            {
                htmlAttributes.Properties = shared ? Properties : Properties != null ? new (Properties) : null;
            }
            else if (Properties != null)
            {
                if (mergeIdAndProperties)
                {
                    foreach (var prop in Properties)
                    {
                        htmlAttributes.AddPropertyIfNotExist(prop.Key, prop.Value);
                    }
                }
                else
                {
                    htmlAttributes.Properties.AddRange(Properties);
                }
            }
        }
public void CopyTo ( HtmlAttributes htmlAttributes , bool mergeIdAndProperties = false , bool shared = true ) { if ( htmlAttributes is null ) ThrowHelper . ArgumentNullException ( nameof ( htmlAttributes ) ) ; if ( ! mergeIdAndProperties || Id != null ) { htmlAttributes . Id = Id ; } if ( htmlAttributes . Classes is null ) { htmlAttributes . Classes = shared ? Classes : Classes != null ? new ( Classes ) : null ; } else if ( Classes != null ) { htmlAttributes . Classes . AddRange ( Classes ) ; } if ( htmlAttributes . Properties is null ) { htmlAttributes . Properties = shared ? Properties : Properties != null ? new ( Properties ) : null ; } else if ( Properties != null ) { if ( mergeIdAndProperties ) { foreach ( var prop in Properties ) { htmlAttributes . AddPropertyIfNotExist ( prop . Key , prop . Value ) ; } } else { htmlAttributes . Properties . AddRange ( Properties ) ; } } }
Copies/merge the values from this instance to the specified  instance.
Copies / merge the values from this instance to the specified instance .
// Add html htmlAttributes to the object
None
htmlAttributes
HtmlAttributes
The HTML attributes.
The HTML attributes .
mergeIdAndProperties
bool
If set to truefalse
If set to truefalse
shared
bool
If set to truetrue
If set to truetrue