tx
2025-04-09 fa7510e1ed63df0366787fa4ed1b3db6426d2b46
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
57
using System;
using System.Collections.Generic;
 
namespace TProduct.Model
{
    public class LinkInfo4Bench
    {
        public LinkInfo4Bench()
        {
 
        }
        public LinkInfo4Bench(string jsonString)
        {
            FromJsonString(jsonString);
        }
        public LinkInfo4Bench(LinkInfo4Bench rhs)
        {
            this.ReceiveWaitTime = rhs.ReceiveWaitTime;
            this.PollTime = rhs.PollTime;
        }
 
        public string ToJsonString()
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            if (this.ReceiveWaitTime > 0)
                dict["RWT"] = this.ReceiveWaitTime.ToString();
            if (this.PollTime > 0)
                dict["POT"] = this.PollTime.ToString();
 
            string json = (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(dict);
 
            return json;
        }
 
        public void FromJsonString(string jsonString)
        {
            if (string.IsNullOrEmpty(jsonString))
                return;
            Dictionary<string, string> dict = (new System.Web.Script.Serialization.JavaScriptSerializer()).Deserialize(jsonString, typeof(Dictionary<string, string>)) as Dictionary<string, string>;
            if (dict.ContainsKey("RWT"))
                this.ReceiveWaitTime = Convert.ToInt32(dict["RWT"]);
            if (dict.ContainsKey("POT"))
                this.PollTime = Convert.ToInt32(dict["POT"]);
 
        }
 
 
 
        #region Model
        protected int _receiveWaitTime = 180;//发送查询,等待时间
        public int ReceiveWaitTime { get { return _receiveWaitTime; } set { _receiveWaitTime = value; } }
 
        protected int _pollTime = 300;//定时器轮询时间
        public int PollTime { get { return _pollTime; } set { _pollTime = value; } }
        #endregion Model
    }
}