I've created a property grid which has a custom array value. When the users selects one of the drop downs I want it to display a form. My problem isn't that it doesn't work, it's not it's over active and shows the form about 6 times despite only being declared once. If I choose ShowDialog it displays the form twice and on attempting to close the second dialog it creates another two instances of the form. Below is the code I'm using. I can't figure out what is wrong.
//Property Grid Type
internal class TransferConnectionPropertyConverter : StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(new string[] { "", NEW_CONN });
}
}
//Property Grid Node
[Category("Connection"),
Description("Specifies the type of connection for this task.")]
[TypeConverter(typeof(TransferConnectionPropertyConverter))]
public string TransferProtocol
{
get
{
if (stConnectionType == NEW_CONN)
{
ConnectionDetailsForm connDetails = new ConnectionDetailsForm();
connDetails.Show();
}
return stConnectionType;
}
set
{
stConnectionType = value;
}
}