Ejemplo n.º 1
0
        public void SendTo(string HostIP, int PortNum, string parameter, string Sender, int ShowtType, int ShowTime)
        {
            MessageCommunication message = new MessageCommunication(Guid.Empty, parameter, Sender, ShowtType, ShowTime);
            IMessageProcessor    im      = (IMessageProcessor)message;

            if (PortNum == 0)
            {
                Send(HostIP, im);
            }
            else
            {
                Send(HostIP, PortNum, im);
            }
        }
Ejemplo n.º 2
0
        public void SendTo(string HostIP, int PortNum, TrasenFrame.Classes.MessageInfo msgInfo)
        {
            MessageCommunication message = new MessageCommunication(msgInfo.MessageId, msgInfo.Summary, msgInfo.SenderName, (msgInfo.IsMustRead ? 1 : 0), msgInfo.ShowTime);

            message.SendTime = DateTime.Now;
            message.Color    = msgInfo.FontColor;
            IMessageProcessor im = (IMessageProcessor)message;

            if (PortNum == 0)
            {
                Send(HostIP, im);
            }
            else
            {
                Send(HostIP, PortNum, im);
            }
        }
Ejemplo n.º 3
0
        private void ucTip_ClickedLinkLabel(object sender, MessageCommunication Message, Action action, ref bool cancel)
        {
            //标记消息为已读
            if (action == Action.SetReaded)
            {
                if (messageContentClicked != null)
                {
                    messageContentClicked(Message.MessageId, action, ref cancel);
                }
                if (cancel)
                {
                    return;
                }

                plMessageList.Controls.Remove((Control)sender);
                if (plMessageList.Controls.Count == 0)
                {
                    this.Hide();
                }

                return;
            }
            //下次处理
            if (action == Action.NextTimeDeal)
            {
                plMessageList.Controls.Remove((Control)sender);
                if (plMessageList.Controls.Count == 0)
                {
                    this.Hide();
                }
                return;
            }

            //处理消息
            if (action == Action.ViewDetail)
            {
                plMessageList.Controls.Remove((Control)sender);
                if (plMessageList.Controls.Count == 0)
                {
                    this.Hide();
                }
                OnMessageContentClickedHander handler = new OnMessageContentClickedHander(LinkLabelClicked);
                IAsyncResult result = handler.BeginInvoke(Message.MessageId, action, ref cancel, new AsyncCallback(CallbackMethod), "");
            }
        }