using System;
|
using System.Collections.Generic;
|
using HDL_ON.DAL;
|
|
namespace HDL_ON
|
{
|
[System.Serializable]
|
public class RemoteInfo
|
{
|
static RemoteInfo ()
|
{
|
Current = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoteInfo> (CommonPage.MyEncodingUTF8.GetString (MyIO.FileUtils.ReadFile ("RemoteInfoMsgList")));
|
if (Current == null)
|
Current = new RemoteInfo ();
|
}
|
|
public static RemoteInfo Current {
|
get;
|
private set;
|
}
|
|
public List<RemoteInfoMsg> RemoteInfoList = new List<RemoteInfoMsg> ();
|
|
|
public void Del (RemoteInfoMsg msg)
|
{
|
RemoteInfoList.Remove (msg);
|
Save ();
|
}
|
|
public void CleanAll ()
|
{
|
Current.RemoteInfoList.Clear ();
|
Save ();
|
}
|
|
public void Save ()
|
{
|
var saveBytes = CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (Current));
|
MyIO.FileUtils.WriteFileByBytes ("RemoteInfoMsgList", saveBytes);
|
}
|
}
|
|
[System.Serializable]
|
public class RemoteInfoMsg
|
{
|
public long MsgID;
|
|
public string Msg;
|
|
public string MsgType;
|
|
public DateTime MsgTime;
|
|
}
|
}
|