public CodeAttributeDeclaration FindAttribute(string attributeName)
{
if (string.IsNullOrEmpty(attributeName))
{
throw new ArgumentException("attributeName could not be null or an empty string.");
}
if (attributesCache.ContainsKey(attributeName))
{
return attributesCache[attributeName];
}
foreach (CodeAttributeDeclaration attribDecl in extendedObject.CustomAttributes)
{
if (attribDecl.Name == attributeName)
{
attributesCache.Add(attributeName, attribDecl);
return attribDecl;
}
}
return null;
}