Example #1
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            object     result  = null;
            EDSVector3 vector3 = (EDSVector3)value;

            if (destinationType == typeof(string))
            {
                result = vector3.ToString();
            }

            return(result ?? base.ConvertTo(context, culture, value, destinationType));
        }
Example #2
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            object result      = null;
            string stringValue = value as string;

            if (!string.IsNullOrEmpty(stringValue))
            {
                float[] values = ConverterUtils.ConvertStringToFloats(stringValue, 3);
                result = new EDSVector3(values);
            }

            return(result ?? base.ConvertFrom(context, culture, value));
        }