private IList ComputeItems()
{
IList items = new List<object>();
if( ItemType == null )
return items;
string[] textArray = Text.Split( '\n' );
foreach( string s in textArray )
{
string valueString = s.TrimEnd( '\r' );
if( !String.IsNullOrEmpty( valueString ) )
{
object value = null;
try
{
if( ItemType.IsEnum )
{
value = Enum.Parse( ItemType, valueString );
}
else
{
value = Convert.ChangeType( valueString, ItemType );
}
}
catch
{
//a conversion failed
_conversionFailed = true;
}
if( value != null )
items.Add( value );
}
}
return items;
}