public static void Reload(ISingletonWatcher inst) { var PyhsicalPath = PathHelper.GetDataPath(inst.WatcherFile); if (!File.Exists(PyhsicalPath)) { PyhsicalPath = ResourceHelper.CopyToAppData(inst.GetType(), inst.WatcherFile); } using (StreamReader reader = new StreamReader(PyhsicalPath, Encoding.UTF8)) { var json = reader.ReadToEnd().Replace("\n", "").Replace("\r", "").Trim(); var type = inst.GetType(); var other = JsonConvert.DeserializeObject(json, type); MyReflectionHelper.InvokeMethod(typeof(Mapper), "Map", new Type[] { type, type }, null, new[] { other, inst }); // Mapper.Map(, this); } }
public static MetaData GetMetaData(Type type) { return(_cacheMetaData.GetOrAdd(type, t => MyReflectionHelper.InvokeMethod(typeof(MetaDataHelper), "GetMetaData", new Type[] { t }) as MetaData)); }