Example #1
0
        /// <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);
            }
        }
Example #2
0
        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);
        }
Example #4
0
 private static void AssertAttributeAdded(IDotAttribute attribute, Type attributeType, object attributeValue)
 {
     Assert.IsInstanceOfType(attributeType, attribute);
     Assert.AreEqual(attribute.Value, attributeValue);
 }