That's it, itembuilderconverter,
Finally, I figured out what icomponent. Site meant.
Public class itembuilderconverter: typeconverter
{
Public override bool canconvertfrom (itypedescriptorcontext context, type sourcetype)
{
If (sourcetype = typeof (string ))
Return true;
Return base. canconvertfrom (context, sourcetype );
}
Public override bool canconvertion (itypedescriptorcontext context, type destinationtype)
{
If (destinationtype = typeof (string ))
Return true;
Return base. canconvertize (context, destinationtype );
}
Public override object convertfrom (itypedescriptorcontext context, cultureinfo culture, object value)
{
If (value = NULL | value. tostring () = string. Empty) return string. empty;
Object result = context. Container. components [value. tostring ()];
If (result! = NULL)
{
Return Value. tostring ();
}
Return string. empty;
}
Public override object convertion (itypedescriptorcontext context, cultureinfo culture, object value, type destinationtype)
{
If (destinationtype = NULL) throw new exception ("the target type is null ");
If (value = NULL) return NULL;
Return base. convertize (context, culture, value, destinationtype );
}
Public override bool getstandardvaluessupported (itypedescriptorcontext context)
{
Return true;
}
Public override standardvaluescollection getstandardvalues (itypedescriptorcontext context)
{
Ilist list = new arraylist ();
Ienumerator itor = context. Container. components. getenumerator ();
While (itor. movenext ())
{
Object item = itor. Current;
If (item is ilistsbuilder)
{
List. Add (icomponent) item). Site. Name );
}
}
If (list. Count> 0)
{
Return new standardvaluescollection (list );
}
Return base. getstandardvalues (context );
}
}