wxr
2019-11-25 29a6e6d747d13fc285c8dd86649417f60613388f
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
 
    }
}