Beispiel #1
0
 public Book(MySize size)
 {
     Size = size;
 }
Beispiel #2
0
 public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
 {
     int[] values = new int[2];
     int i = 0;
     if (value != null)
     {
         foreach (string s in (value as string).Split(','))
         {
             if (!int.TryParse(s, out values[i++]))
                 throw new FormatException(String.Format("At arg {0} can not covert {1} to int", i, s));
         }
     }
     MySize size = new MySize();
     size.X = values[0];
     size.Y = values[1];
     return size;
 }