Svg.SvgPathBuilder.ConvertTo C# (CSharp) Method

ConvertTo() public method

public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
destinationType System.Type
return object
		public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
		{
			if (destinationType == typeof(string))
            {
                var paths = value as SvgPathSegmentList;

                if (paths != null)
                {
                	var curretCulture = CultureInfo.CurrentCulture;
                	Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                	var s = string.Join(" ", paths.Select(p => p.ToString()).ToArray());
                	Thread.CurrentThread.CurrentCulture = curretCulture;
                    return s;
                }
            }

			return base.ConvertTo(context, culture, value, destinationType);
		}