|
using System;
using System.ComponentModel;
namespace Puma.Controls.PropertyGrid
{
public class PropertyGridChildItemsExImpl : PropertyGridChildItemsDelegator, IPropertyGridChildItemsEx
{
internal protected PropertyGridChildItemsExImpl(IPropertyGridChildItems IPropertyGridChildItems, IPropertyGridItemEx Container)
: base(IPropertyGridChildItems)
{
//
// TODO: Add constructor logic here
//
this.Container = Container;
System.ComponentModel.PropertyDescriptorCollection propertyDescriptorCollection = new System.ComponentModel.PropertyDescriptorCollection(null);
foreach (IPropertyGridItem child in IPropertyGridChildItems.GetAllContainedItems())
{
IPropertyGridItemEx item = OnPropertyGridItemExCreated(child, Container);
if (item != null)
{
if (item.IsCategory)
{
foreach (IPropertyGridItem subChild in child.Childs.GetAllContainedItems())
{
IPropertyGridItemEx subItem = OnPropertyGridItemExCreated(subChild, item);
if (subItem != null)
{
System.Diagnostics.Debug.Assert(subItem.PropertyDescriptor != null);
propertyDescriptorCollection.Add(subItem.PropertyDescriptor);
}
}
}
else
{
System.Diagnostics.Debug.Assert(item.PropertyDescriptor != null);
propertyDescriptorCollection.Add(item.PropertyDescriptor);
}
}
}
_propertyDescriptorCollection = new PropertyDescriptorCollection(propertyDescriptorCollection);
}
protected readonly IPropertyGridItemEx Container;
protected virtual IPropertyGridItemEx OnPropertyGridItemExCreated(IPropertyGridItem IPropertyGridItem, IPropertyGridItemEx Parent)
{
return new PropertyGridItemExImpl(IPropertyGridItem, Parent);
}
private readonly PropertyDescriptorCollection _propertyDescriptorCollection;
#region IPropertyGridChildItemsEx Members
public virtual System.ComponentModel.PropertyDescriptorCollection PropertyDescriptorCollection
{
get
{
// TODO: Add PropertyGridChildItemsExDef.PropertyDescriptorCollection getter implementation
return _propertyDescriptorCollection;
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.