Esempio n. 1
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var rotation = (Point3d)base.ConvertFrom(context, culture, value);

            return(new Point3d(
                       DegreeConverter.DegreeToRadian(rotation.X),
                       DegreeConverter.DegreeToRadian(rotation.Y),
                       DegreeConverter.DegreeToRadian(rotation.Z)));
        }
Esempio n. 2
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            var rotation = (Point3d)value;

            value = new Point3d(
                DegreeConverter.RadianToDegree(rotation.X),
                DegreeConverter.RadianToDegree(rotation.Y),
                DegreeConverter.RadianToDegree(rotation.Z));
            return(base.ConvertTo(context, culture, value, destinationType));
        }