using System.ComponentModel; namespace Volian.Svg.Library { public static class SvgXmlConverter where T : class { public static string GetString(T myObject) { if (myObject == null) return null; TypeConverter FontConverter = TypeDescriptor.GetConverter(typeof(T)); return FontConverter.ConvertToInvariantString(myObject); } public static T GetObject(string value) => (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(value); } }