Exemple #1
0
        private void AddAttribute(AttributeNode node)
        {
            if (node.Key == "id")
            {
                if (node.Value != null && node.Value.Contains("."))
                {
                    var values = node.Value.Split(".".ToCharArray());
                    foreach (var value in values.Skip(1))
                    {
                        Attributes.Add(new AttributeNode("class", value));
                    }

                    Attributes.Add(new AttributeNode(node.Key, values[0]));
                    return;
                }
            }

            Attributes.Add(node);
        }
Exemple #2
0
 public AttributeList(AttributeNode attributeNode, string key, string value)
 {
     _list.Add(attributeNode);
     _list.Add(new AttributeNode(key, value));
 }