Magpie/CursorHook/ServerInterface.cs
2021-03-14 14:35:10 +08:00

33 lines
972 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace Magpie.CursorHook {
/// <summary>
/// Provides an interface for communicating from the client (target) to the server (injector)
/// </summary>
public class ServerInterface : MarshalByRefObject {
public void ReportMessages(string[] messages) {
foreach (var msg in messages) {
ReportMessage(msg);
}
}
public void ReportMessage(string message) {
Console.WriteLine("##CursorHook##: " + message);
}
/// <summary>
/// Report exception
/// </summary>
/// <param name="e"></param>
public void ReportException(Exception e) {
Console.WriteLine("##CursorHook##: " + "IPC出错" + e.ToString());
}
/// <summary>
/// Called to confirm that the IPC channel is still open / host application has not closed
/// </summary>
public void Ping() {
}
}
}