Exemplo n.º 1
0
 public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
 {
     if (value is string)
     {
         string[] parts = ((string)value).Split(new char[] { ',' });
         Server server = new Server();
         server.Host = parts[0];
         if (parts.Length > 1) server.Port = int.Parse(parts[1]);
         return server;
     }
     return base.ConvertFrom(context, culture, value);
 }
Exemplo n.º 2
0
 public MPC(Server server)
     : this(server.Host, server.Port)
 {
 }