This commit is contained in:
Rich
2010-03-25 19:38:51 +00:00
parent 076fcfae10
commit 74673d17ae
32 changed files with 5048 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace Volian.Svg.Library
{
public static class SvgXmlConverter<T> 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)
{
TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));
return (T)converter.ConvertFromInvariantString(value);
}
}
}