/** * Sets the number value to store * @param key * @param value */ public static void SetNumber(String key, double value) { #if NETFX_CORE StorageSettings iss = Defines.GetStorageSettings(); #else IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings; #endif iss[key] = value; iss.Save(); }
/** * Gets number value stored at key * @param key * @return */ public static double GetNumber(String key) { #if NETFX_CORE StorageSettings iss = Defines.GetStorageSettings(); #else IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings; #endif if (iss.Contains(key)) { return(Convert.ToDouble(iss[key])); } return(0); }
/** * Gets string value stored at key * @param key * @return */ public static String GetString(String key) { #if NETFX_CORE StorageSettings iss = Defines.GetStorageSettings(); #else IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings; #endif String value = ""; if (iss.TryGetValue <String>(key, out value)) { return(value); } return(null); }
/** * Gets value stored at key * @param key * @return */ public static Object Get(String key) { #if NETFX_CORE StorageSettings iss = Defines.GetStorageSettings(); #else IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings; #endif String value = ""; if (iss.TryGetValue <String>(key, out value)) { return(value); } else { if (iss.Contains(key)) { return(Convert.ToDouble(iss[key])); } else { return(null); } } }