Beispiel #1
0
        protected virtual void raiseEvent(EventString message)
        {
            EventHandler <EventString> handler = es;

            if (handler != null)
            {
                handler(this, message);
            }
        }
Beispiel #2
0
        private void _threadLoop()
        {
            while (_is_start)
            {
                string  strResult  = GetNews();
                dynamic jsonResult = JsonConvert.DeserializeObject(strResult);
                int     action     = jsonResult.Action;

                if (0 != action)
                {
                    EventString es = new EventString {
                        JsonString = strResult
                    };
                    raiseEvent(es);
                }

                Thread.Sleep(500);
            }
        }