Castle.MonoRail.Framework.ViewComponent.SupportsSection C# (CSharp) Method

SupportsSection() public method

Implementor should return true only if the name is a known section the view component supports.
public SupportsSection ( string name ) : bool
name string section being added
return bool
		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;
		}