コード例 #1
0
 public override object ConvertFromInvariantString(string value)
 {
     return(new MatrixTransform
     {
         Matrix = MatrixTypeConverter.CreateMatrix(value)
     });
 }
コード例 #2
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (value is not MatrixTransform mt)
            {
                throw new NotSupportedException();
            }
            var converter = new MatrixTypeConverter();

            return(converter.ConvertToInvariantString(mt.Matrix));
        }
コード例 #3
0
        public override string ConvertToInvariantString(object value)
        {
            if (!(value is MatrixTransform mt))
            {
                throw new NotSupportedException();
            }
            var converter = new MatrixTypeConverter();

            return(converter.ConvertToInvariantString(mt.Matrix));
        }
コード例 #4
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 => new MatrixTransform
 {
     Matrix = MatrixTypeConverter.CreateMatrix(value?.ToString())
 };