public virtual bool SupportsSection(string name)
{
// TODO: We need to cache this
if (sectionsFromAttribute == null)
{
object[] attributes = GetType().GetCustomAttributes(typeof(ViewComponentDetailsAttribute), true);
if (attributes.Length != 0)
{
ViewComponentDetailsAttribute detailsAtt = (ViewComponentDetailsAttribute) attributes[0];
if (!string.IsNullOrEmpty(detailsAtt.Sections))
{
sectionsFromAttribute = detailsAtt.Sections.Split(',');
}
}
if (sectionsFromAttribute == null)
{
sectionsFromAttribute = new string[0];
}
}
return Array.Find(sectionsFromAttribute,
delegate(string item)
{ return string.Equals(item, name, StringComparison.InvariantCultureIgnoreCase); }) != null;
}