Пример #1
0
        private void OnBroadcastMessages()
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "OnBroadcastMessages");

            try
            {
                while (!this.ExecutorService.WaitForShutdown())
                {
                    try
                    {
                        AppNotifyData data = _queue.Dequeue();
                        AppNotifyService.OnNotifyData(data);
                    }
                    catch (Exception ex)
                    {
                        Log.Exception(PROC, ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
                _host = null;
            }
            finally
            {
                this.Stop();
            }
        }
        private void OnReceiveMessages()
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "OnReceiveMessages");

            try
            {
                while (!this.ExecutorService.WaitForShutdown())
                {
                    try
                    {
                        AppNotifyData data = _queue.Dequeue();
                        if (data != null && _callback != null)
                        {
                            _callback.NotifyData(data);
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Exception(PROC, ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
            finally
            {
                this.Shutdown();
            }
        }
        internal static void OnNotifyData(AppNotifyData data)
        {
            ModuleProc PROC = new ModuleProc("AppNotifyService", "OnNotifyData");

            try
            {
                if (NotifyData != null)
                {
                    NotifyData(null, new AppNotifyDataEventArgs(data));
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
        internal static void OnNotifyData(AppNotifyData data)
        {
            ModuleProc PROC = new ModuleProc("AppNotifyService", "OnNotifyData");

            try
            {
                if (NotifyData != null)
                {
                    NotifyData(null, new AppNotifyDataEventArgs(data));
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
Пример #5
0
        public void PostMessage(AppNotifyData data)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "PostMessage");

            try
            {
                if (_host != null)
                {
                    _queue.Enqueue(data);
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
                _host = null;
            }
        }
 public void NotifyData(AppNotifyData data)
 {
     _queue.Enqueue(data);
 }
        public void PostMessage(AppNotifyData data)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "PostMessage");

            try
            {
                if (_host != null)
                {
                    _queue.Enqueue(data);
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
                _host = null;
            }
        }
 public void NotifyData(AppNotifyData data)
 {
     _queue.Enqueue(data);
 }
 public AppNotifyDataEventArgs(AppNotifyData data)
 {
     this.Data = data;
 }
 public AppNotifyDataEventArgs(AppNotifyData data)
 {
     this.Data = data;
 }