IJsonDistService.cs 954 Bytes
using FObjBase;
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
    {
        void GetValue(string key, AsyncCBHandler asyncCB, object asyncContext);
        void SetValue(string key, JObject value);

        event JsonDistValueChangedEventHandler 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, JsonDistValueValueChangedEventArgs e);

    public class JsonDistValueValueChangedEventArgs 
    {
        public string key;
    }
}