init commit

This commit is contained in:
Tommy Parnell
2014-02-23 12:51:09 -05:00
parent e214e59fa1
commit 382aea9431
8 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace SharedSettingsAbstraction.Extensions
{
public static class AndroidExtensions
{
public static void SaveObject ( this ISharedPreferencesEditor ed, string key, object value)
{
var refType = value.GetType();
if (refType == typeof(string))
{
ed.PutString(key,(String)value);
}
if (refType == typeof(bool))
{
ed.PutBoolean(key, (bool)value);
}
if (refType == typeof(int))
{
ed.PutInt(key, (int)value);
}
if (refType == typeof(float))
{
ed.PutFloat(key, (float)value);
}
}
}
}