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
using FObjBase;
using FObjBase.Reflect;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.OBJComponents.IService
{
public interface IJsonDistService
{
[Call(typeof(DistCell))]
void GetValue(string key, AsyncCBHandler asyncDelegate, object asyncContext);
void SetValue(string key, JObject value);
//event JsonDistValueChangedEventHandler ValueChanged;
[Push(typeof(JsonDistValueChangedEventArgs))]
event EventHandler ValueChanged;
}
public class DistCell
{
public string Key;
public DateTime Time;
public JObject Value;
public override string ToString()
{
return $"[{Key}]={Newtonsoft.Json.JsonConvert.SerializeObject(Value)}";
}
}
public delegate void JsonDistValueChangedEventHandler(object sender, JsonDistValueChangedEventArgs e);
public class JsonDistValueChangedEventArgs: EventArgs
{
public string key;
}
}