/// <summary> /// Creates a new instance of the agent, which will immediately start listening for Airfoil messages /// intended for the specified process and passing them along to the provided listener. /// </summary> /// <param name="listener">An AirfoilAgentListener that will receive notifications of incoming messages.</param> /// <param name="process">The ID of the process for which to listen for incoming messages.</param> public Agent(AirfoilAgentListener listener, int process) { agentListener = listener; messageBuffer = new AirfoilMessageBuffer(); ListenForProcessId = process; Start(); }
/// <summary> /// Creates a new instance of the agent, which will immediately start listening for Airfoil messages /// intended for the current process and passing them along to the provided listener. /// </summary> /// <param name="listener">An AirfoilAgentListener that will receive notifications of incoming messages.</param> public Agent(AirfoilAgentListener listener) : this(listener, Process.GetCurrentProcess().Id) { }