public void AddAttribute (AttributeCodeElement attribute) { AttributeCodeElement existingAttribute = Attributes.Find ((a) => a.Name == attribute.Name); if (existingAttribute != null) { Attributes.Remove (existingAttribute); } Attributes.Add (attribute); }
/// <summary> /// Adds the given attribute to all methods, fields, constructors and properties. /// </summary> /// <param name="attribute">Attribute.</param> public void AddAttributeToAllMembers(AttributeCodeElement attribute) { Constructors.ForEach((c) => c.AddAttribute(attribute)); Methods.ForEach((c) => c.AddAttribute(attribute)); Properties.ForEach((c) => c.AddAttribute(attribute)); Fields.ForEach((c) => c.AddAttribute(attribute)); }
public void AddAttribute(AttributeCodeElement attribute) { AttributeCodeElement existingAttribute = Attributes.Find((a) => a.Name == attribute.Name); if (existingAttribute != null) { Attributes.Remove(existingAttribute); } Attributes.Add(attribute); }
/// <summary> /// Adds the given attribute to all methods, fields, constructors and properties. /// </summary> /// <param name="attribute">Attribute.</param> public void AddAttributeToAllMembers (AttributeCodeElement attribute) { Constructors.ForEach ((c) => c.AddAttribute (attribute)); Methods.ForEach ((c) => c.AddAttribute (attribute)); Properties.ForEach ((c) => c.AddAttribute (attribute)); Fields.ForEach ((c) => c.AddAttribute (attribute)); }