2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
9 [MethodImpl(MethodImplOptions.InternalCall)]
10 private static extern bool TrySetInt(
string key,
int value);
12 [MethodImpl(MethodImplOptions.InternalCall)]
13 private static extern bool TrySetFloat(
string key,
float value);
15 [MethodImpl(MethodImplOptions.InternalCall)]
16 private static extern bool TrySetString(
string key,
string value);
23 public static void SetInt(
string key,
int value)
25 if (!TrySetInt(key, value))
27 throw new Exception(
"Could not store preference value");
36 [MethodImpl(MethodImplOptions.InternalCall)]
37 public static extern int GetInt(
string key,
int defaultValue);
54 public static void SetFloat(
string key,
float value)
56 if (!TrySetFloat(key, value))
58 throw new Exception(
"Could not store preference value");
67 [MethodImpl(MethodImplOptions.InternalCall)]
68 public static extern float GetFloat(
string key,
float defaultValue);
85 public static void SetString(
string key,
string value)
87 if (!TrySetString(key, value))
89 throw new Exception(
"Could not store preference value");
98 [MethodImpl(MethodImplOptions.InternalCall)]
99 public static extern string GetString(
string key,
string defaultValue);
115 [MethodImpl(MethodImplOptions.InternalCall)]
116 public static extern bool HasKey(
string key);
122 [MethodImpl(MethodImplOptions.InternalCall)]
128 [MethodImpl(MethodImplOptions.InternalCall)]
134 [MethodImpl(MethodImplOptions.InternalCall)]
135 public static extern void Save();
static string GetString(string key)
static void DeleteKey(string key)
static float GetFloat(string key)
static void SetFloat(string key, float value)
static void SetString(string key, string value)
static int GetInt(string key, int defaultValue)
static string GetString(string key, string defaultValue)
static float GetFloat(string key, float defaultValue)
static void SetInt(string key, int value)
static bool HasKey(string key)
static int GetInt(string key)