public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { string str = value as string; if (str != null) { return(ConnectionInfoCollection.FromString(str)); } else { return(base.ConvertFrom(context, culture, value)); } }
public static ConnectionInfoCollection FromString(String input) { ConnectionInfoCollection collection = new ConnectionInfoCollection(); if (string.IsNullOrWhiteSpace(input)) { return(collection); } string[] inputs = input.Split('~'); foreach (var i in inputs) { if (!String.IsNullOrWhiteSpace(i)) { collection.Add(ConnectionInfo.FromString(i)); } } return(collection); }