private static void SendPingPong(MyLib lib) { while (true) { Thread.Sleep(1000); lib.pokeNativeEvent("Ping from .net"); } }