summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/TypeConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/TypeConverter.cs')
-rw-r--r--Xamarin.Forms.Core/TypeConverter.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/TypeConverter.cs b/Xamarin.Forms.Core/TypeConverter.cs
new file mode 100644
index 00000000..7bbf221f
--- /dev/null
+++ b/Xamarin.Forms.Core/TypeConverter.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Globalization;
+
+namespace Xamarin.Forms
+{
+ public abstract class TypeConverter
+ {
+ public virtual bool CanConvertFrom(Type sourceType)
+ {
+ if (sourceType == null)
+ throw new ArgumentNullException("sourceType");
+
+ return sourceType == typeof(string);
+ }
+
+ [Obsolete("use ConvertFromInvariantString (string)")]
+ public virtual object ConvertFrom(object o)
+ {
+ return null;
+ }
+
+ [Obsolete("use ConvertFromInvariantString (string)")]
+ public virtual object ConvertFrom(CultureInfo culture, object o)
+ {
+ return null;
+ }
+
+ public virtual object ConvertFromInvariantString(string value)
+ {
+ return ConvertFrom(CultureInfo.InvariantCulture, value);
+ }
+ }
+} \ No newline at end of file