private void Hooker_OnProcessStarted(Hooker <T> obj) { Process process = Process.GetProcessById(obj.Proxy.ProcessId); obj.Proxy.Start(); // to do }
private void Hooker_OnProcessExited(Hooker <T> obj) { obj.Proxy.Stop(); Hooks.Remove(obj.ProxyPort); // to do }
public Hooker <T> CreateHooker() { Hooker <T> hooker = new Hooker <T>(AvailablePort); hooker.OnProcessExited += Hooker_OnProcessExited; hooker.OnProcessStarted += Hooker_OnProcessStarted; Hooks.Add(hooker.ProxyPort, hooker); return(hooker); }