using System;
|
using System.Collections.Generic;
|
using HDL_ON.DAL;
|
using HDL_ON.Entity;
|
using Shared;
|
|
namespace HDL_ON
|
{
|
[System.Serializable]
|
public class OnAppConfig
|
{
|
|
static OnAppConfig instance;
|
public static OnAppConfig Instance {
|
get {
|
if (instance == null) {
|
try {
|
var userConfigBytes = FileUtils.ReadFile ("OnAppConfig");
|
var userConfigString = System.Text.Encoding.UTF8.GetString (userConfigBytes);
|
OnAppConfig temp = null;
|
if (userConfigString != null) {
|
temp = Newtonsoft.Json.JsonConvert.DeserializeObject<OnAppConfig> (userConfigString);
|
}
|
if (temp == null) {
|
instance = new OnAppConfig { };
|
} else {
|
instance = temp;
|
}
|
} catch { }
|
}
|
return instance;
|
}
|
}
|
|
byte [] GetUserConfigBytes ()
|
{
|
return System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (this));
|
}
|
|
public void RefreshUserConfig ()
|
{
|
instance = null;
|
}
|
|
public void SaveUserConfig ()
|
{
|
FileUtils.WriteFileByBytes ("OnAppConfig", GetUserConfigBytes ());
|
}
|
/// <summary>
|
/// 信息推送标记
|
/// </summary>
|
public string PushDeviceToken;
|
|
public string SetLanguage = "";
|
|
/// <summary>
|
/// 软件解锁界面
|
/// 1:启动时
|
/// 2:布防撤防时
|
/// 3:远程开锁时
|
/// </summary>
|
public List<string> appUnlockPage = new List<string>();
|
/// <summary>
|
/// 软件解锁方式
|
/// 1:数字密码
|
/// 2:手势密码
|
/// 3:指纹密码
|
/// 4:面容ID
|
/// </summary>
|
public List<string> appUnlockType = new List<string>();
|
/// <summary>
|
/// 软件解锁密码
|
/// </summary>
|
public string appUnlockPasswrod = "";
|
/// <summary>
|
/// 解锁时间
|
/// </summary>
|
public DateTime unlockTime = DateTime.MinValue;
|
}
|
}
|