标签:reflect dfa 方法 cad static ber load private lan
private List<GetNewDateDTO> Reflection()
{
object obj;
Assembly assembly = Assembly.Load("NetGet.UI");//加载DLL,NetGet.UI 为类库名称
Type t = assembly.GetType("NetGet.UI.GetNewData.GetNewDataMastMVP.GetNewDataMastModel");
//不是静态方法需要用到这一部分
obj = t.InvokeMember(null,
BindingFlags.DeclaredOnly |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
List<GetNewDateDTO> a;
a = (List<GetNewDateDTO>)t.InvokeMember("Query", BindingFlags.Public | BindingFlags.Instance |
BindingFlags.InvokeMethod, null, obj, new Object[] { "" });
return a;
}
public void LoadForm()
{
Assembly assembly = Assembly.Load("NetGet.UI");
Type t = assembly.GetType("NetGet.UI.FormLoadFacade");
var frm = CapitalAnalysisMast.ActiveForm;
t.InvokeMember("GetNewDataMastForm", BindingFlags.Public | BindingFlags.Instance |BindingFlags.Static|
BindingFlags.InvokeMethod, null, null, new Object[] { frm });
LoadData();
}
public void LoadData()
{
Assembly myAs = Assembly.Load("NetGet.UI");
Type T = myAs.GetType("NetGet.UI.GetNewData.GetNewDataListMVP.GetNewDataList");
object obj = T.InvokeMember(null,
BindingFlags.DeclaredOnly |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
List<GetNewDateDTO> a=new List<GetNewDateDTO>();
a = Reflection();
T.InvokeMember("LoadData", BindingFlags.Public | BindingFlags.Instance |BindingFlags.NonPublic|
BindingFlags.InvokeMethod, null, obj, new Object[] { a });
}
标签:reflect dfa 方法 cad static ber load private lan
原文地址:http://www.cnblogs.com/huzige/p/6546912.html