예제 #1
0
        private static void AddClass(LinkInline link, string cssClass)
        {
            HtmlAttributes attributes = link.GetAttributes();

            if (!attributes.Classes.Any(x => x == cssClass))
            {
                attributes.Classes.Add(cssClass);
                link.SetAttributes(attributes);
            }
        }
예제 #2
0
        private static void AddAttribute(LinkInline link, string name, string value)
        {
            HtmlAttributes attributes = link.GetAttributes();

            if (!attributes.Properties.Any(x => x.Key == name))
            {
                attributes.AddPropertyIfNotExist(name, value);
                link.SetAttributes(attributes);
            }
        }