private static void GenDelegate() { DelegateGen delegateGen = new DelegateGen(); delegateGen.Run(m_DllPath, m_DelegatePath); UnityEngine.Debug.Log("GenDelegate Ok!"); }
public static string GetMethodFullName(MethodInfo methodinfo) { string returnstr = DelegateGen.GetTypeName(methodinfo.ReturnType); string name = methodinfo.DeclaringType.FullName + "::" + methodinfo.Name; string paramstr = ""; int count = methodinfo.GetParameters().Length; int index = 1; foreach (var param in methodinfo.GetParameters()) { string split = index++ == count ? "" : ","; paramstr += DelegateGen.GetTypeName(param.ParameterType) + split; } return(returnstr + " " + name + "(" + paramstr + ")"); }
private static void GenDelegate() { string delegatePath = "C:/GiteeSVN/ProtectGold/Research/MSILInject/Demo/Delegate"; string dllPath = "C:/GiteeSVN/ProtectGold/Research/MSILInject/Demo/bin/Debug/Demo.exe"; delegatePath = m_DelegatePath; dllPath = m_DllPath; try { DelegateGen delegateGen = new DelegateGen(); delegateGen.Run(dllPath, delegatePath); Console.WriteLine("GenDelegate Ok!"); } catch (Exception exp) { Console.WriteLine(exp.Message); } }
private void button1_Click(object sender, EventArgs e) { string delegatePath = "C:/GiteeSVN/ProtectGold/Research/MSILInject/Demo/Delegate"; string dllPath = "C:/GiteeSVN/ProtectGold/Research/MSILInject/Demo/bin/Debug/Demo.exe"; delegatePath = m_DelegatePath.Text; dllPath = m_DllPath.Text; try { DelegateGen delegateGen = new DelegateGen(); delegateGen.Run(dllPath, delegatePath); m_log.Text = "生成完毕!"; } catch (Exception exp) { m_log.Text = exp.Message; } }