Esempio n. 1
0
 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();
            }
        }
Esempio n. 3
0
 private static extern void get_app_name(ref AppInfo appInfo, IntPtr ctx, Callback1 <String> o_cb);
Esempio n. 4
0
 private static extern void get_app_id(ref AppInfo appInfo, IntPtr ctx, Callback1 <int> o_cb);
Esempio n. 5
0
        private void OnAsyncPingTime(object state)
        {
            Callback1 callback = (Callback1)state;

            callback.Pong(0);
        }
Esempio n. 6
0
 public void Ping1(int code, Callback1 callback)
 {
     callback.Pong(code);
 }
Esempio n. 7
0
 public void RemoveEventCallback1(Callback1 callback1)
 {
     this.callback1 -= callback1;
 }
Esempio n. 8
0
 public void AddEventCallback1(Callback1 callback1)
 {
     this.callback1 += callback1;
 }
Esempio n. 9
0
 public void AsyncPing(int delayInSecs, Callback1 callback) {
     if (this.asyncPingTimer == null) {
         this.asyncPingTimer = new Timer(this.OnAsyncPingTime, callback, delayInSecs * 1000, Timeout.Infinite);
     }
 }
Esempio n. 10
0
 public void Ping1(int code, Callback1 callback) {
     callback.Pong(code);
 }