public void AsyncPing(int delayInSecs, Callback1 callback) { if (this.asyncPingTimer == null) { this.asyncPingTimer = new Timer(this.OnAsyncPingTime, callback, delayInSecs * 1000, Timeout.Infinite); } }
public void SerializationCallback() { { var c1 = new Callback1(0); var d = MessagePackSerializer.Serialize(c1); c1.CalledBefore.IsTrue(); MessagePackSerializer.Deserialize <Callback1>(d).CalledAfter.IsTrue(); } { var before = false; var c1 = new Callback2(0, () => before = true, () => { }); var d = MessagePackSerializer.Serialize(c1); before.IsTrue(); Callback2.CalledAfter.IsFalse(); MessagePackSerializer.Deserialize <Callback2>(d); Callback2.CalledAfter.IsTrue(); } { var c1 = new Callback1_2(0); var d = MessagePackSerializer.Serialize(c1); c1.CalledBefore.IsTrue(); MessagePackSerializer.Deserialize <Callback1_2>(d).CalledAfter.IsTrue(); } { var before = false; var c1 = new Callback2_2(0, () => before = true, () => { }); var d = MessagePackSerializer.Serialize(c1); before.IsTrue(); Callback2_2.CalledAfter.IsFalse(); MessagePackSerializer.Deserialize <Callback2_2>(d); Callback2_2.CalledAfter.IsTrue(); } }
private static extern void get_app_name(ref AppInfo appInfo, IntPtr ctx, Callback1 <String> o_cb);
private static extern void get_app_id(ref AppInfo appInfo, IntPtr ctx, Callback1 <int> o_cb);
private void OnAsyncPingTime(object state) { Callback1 callback = (Callback1)state; callback.Pong(0); }
public void Ping1(int code, Callback1 callback) { callback.Pong(code); }
public void RemoveEventCallback1(Callback1 callback1) { this.callback1 -= callback1; }
public void AddEventCallback1(Callback1 callback1) { this.callback1 += callback1; }