//加载程序集 private static void LoadFileNoCache() { ReflectionSugar rs = new ReflectionSugar(0);//缓存100秒 Assembly ams = rs.LoadFile(@"D:\学习\SyntacticSugar\SyntacticSugar\bin\Debug\SyntacticSugar.dll"); }
//获取实列 private static void CreateInstanceByCache() { ReflectionSugar rs = new ReflectionSugar(100);//缓存100秒 var f = rs.CreateInstance <FileSugar>("SyntacticSugar.FileSugar", "SyntacticSugar"); }
//执行函数 private static void ExecuteMethodNoCache() { ReflectionSugar rs = new ReflectionSugar(0);//缓存0秒 var path = rs.ExecuteMethod("SyntacticSugar", "FileSugar", "GetMapPath", "~/"); }