You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
899 B
C#
29 lines
899 B
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
|
|
namespace Mesnac.Controls.Feeding
|
|
{
|
|
public class StringListConverterParent : TypeConverter
|
|
{
|
|
public override bool GetStandardValuesSupported( ITypeDescriptorContext context )
|
|
{
|
|
return true; // display drop
|
|
}
|
|
public override bool GetStandardValuesExclusive( ITypeDescriptorContext context )
|
|
{
|
|
|
|
return true; // drop-down vs combo
|
|
}
|
|
public override TypeConverter.StandardValuesCollection GetStandardValues( ITypeDescriptorContext context )
|
|
{
|
|
List<string> list=new List<string>();
|
|
|
|
foreach ( Component cmpnt in context.Container.Components )
|
|
{
|
|
list.Add( cmpnt.Site.Name );
|
|
}
|
|
return new TypeConverter.StandardValuesCollection( list );
|
|
}
|
|
}
|
|
}
|