Exemple #1
0
        /// <summary>
        /// 发现有新的信息,这在右下方弹出窗口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void _threadManager_UIAnnouncementCallBackEvent(object sender, AnnouncementEventArgs e)
        {
            if (e.Announcement == null)
            {
                return;
            }
            if (this.InvokeRequired)
            {
                this.Invoke(new EventHandler <AnnouncementEventArgs>(_threadManager_UIAnnouncementCallBackEvent), new object[] { sender, e });
            }
            else
            {
                if (_formPushMessage == null)
                {
                    _formPushMessage          = new FormPushMessage();
                    _formPushMessage.Location = new Point(-1000, 0);
                }
                else
                {
                    _formPushMessage.OpenFormEvent -= _formPushMessage_OpenFormEvent;
                    _formPushMessage.OpenFormEvent += _formPushMessage_OpenFormEvent;
                    _formPushMessage.SetPosition();
                }

                _formPushMessage.SetCustomer(e.Announcement);

                Utility.NativeMethods.ShowWindow(new System.Runtime.InteropServices.HandleRef(_formPushMessage, _formPushMessage.Handle), 4);
            }
        }
Exemple #2
0
 /// <summary>
 /// 显示主界面时,把消息弹出框隐藏在最左边
 /// </summary>
 protected void ShowPushMessageForm()
 {
     try
     {
         if (_formPushMessage == null)
         {
             _formPushMessage = new FormPushMessage();
         }
         _formPushMessage.Show();
         _formPushMessage.Location = new Point(-1000, 0);
         if (_formRemind == null)
         {
             _formRemind = new FormRemind( );
         }
         _formRemind.Show( );
         _formRemind.Location = new Point(-1000, 0);
     }
     catch (Exception ex)
     {
         Utility.LogHelper.WriteException(ex);
     }
 }