-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsHelper.cs
More file actions
32 lines (26 loc) · 869 Bytes
/
SettingsHelper.cs
File metadata and controls
32 lines (26 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
namespace ImageRate
{
public class SettingsHelper
{
private static ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
public static String getStringOrDefault(String key, String defaultValue)
{
String resultString = localSettings.Values[key] as string;
return resultString != null ? resultString : defaultValue;
}
public static int getIntOrDefault(String key, int defaultValue)
{
return int.Parse(getStringOrDefault(key, defaultValue.ToString()));
}
public static void set(String key, object value)
{
localSettings.Values[key] = value.ToString();
}
}
}