/// <summary> /// Adds the attribute to the collection; /// </summary> /// <param name="attribute">The attribute.</param> public void AddAttribute(IDotAttribute attribute) { var attributeType = attribute.GetType(); if (!attributes.ContainsKey(attributeType)) { attributes.Add(attributeType, attribute); } }
public string Compile(IDotAttribute attribute) { if (attribute is T matchingAttribute) { return(OnAttributeTypeMatch(matchingAttribute)); } return(null); }
public string Compile(IDotAttribute attribute, bool shouldFormat) { if (attribute is T matchingAttribute) { return(OnAttributeTypeMatch(matchingAttribute, shouldFormat)); } return(null); }
private static void AssertAttributeAdded(IDotAttribute attribute, Type attributeType, object attributeValue) { Assert.IsInstanceOfType(attributeType, attribute); Assert.AreEqual(attribute.Value, attributeValue); }