예제 #1
0
        public void OnSubscribeHandler(object sender, MessageEventArgs e)
        {
            JsonReading jr = new JsonReading();

            jr.fromJSON(e.Message.ToString());

            JsonReading.Value val = jr.FindValue("ACTION");
            Debug.WriteLine(val.m_obj.ToString());

            m_objManager.UpdateAction(val.m_obj.ToString());
        }
예제 #2
0
        public static void Subscribehandler(object sender, MessageEventArgs e)
        {
            TimeSpan ts     = DateTime.UtcNow - dt;
            long     millis = (long)ts.TotalMilliseconds;

            if (e.Message.ToString().Contains("delete node") != false)
            {
                sc.Unsubscribe("example");
            }
            else
            {
                jr.fromJSON(e.Message.ToString());
                JsonReading.Value val = jr.FindValue("takenAt");

                Double begin   = (Double)val.Obj;
                long   elapsed = millis - (long)begin;
                Debug.WriteLine(elapsed);
            }
        }