public void CopyTo(MonitorCfg cfg) { cfg.ProcessName = ProcessName; cfg.AppName = AppName; cfg.DelayTime = DelayTime; cfg.Interval = Interval; }
public void ReadCfg(string path) { string json = File.ReadAllText(path); MonitorCfg cfg = JsonUtility.Decode <MonitorCfg>(json); cfg.CopyTo(this); }
private static void WriteCfg() { MonitorCfg = new MonitorCfg(); MonitorCfg.ProcessName = "xuyouji"; MonitorCfg.AppName = "虚游记"; MonitorCfg.DelayTime = 10000; MonitorCfg.Interval = 1000; MonitorCfg.WriteCfg(CfgPath); }
private static void ReadCfg() { MonitorCfg = new MonitorCfg(); MonitorCfg.ReadCfg(CfgPath); }