using System;
using System.ComponentModel;
using System.Globalization;

namespace QC.QsprTestObjects.Parameters;

internal class ParamCollectionConverter : ExpandableObjectConverter
{
	public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destType)
	{
		if (destType == typeof(string) && value is ParameterCollection)
		{
			ParameterCollection parameterCollection = (ParameterCollection)value;
			string text = string.Empty;
			{
				foreach (ParameterCls item in parameterCollection)
				{
					if (text.Length > 0)
					{
						text += ", ";
					}
					text += item.Name;
				}
				return text;
			}
		}
		return base.ConvertTo(context, culture, value, destType);
	}
}
