コード例 #1
0
        private void HandleJob(byte[] body)
        {
            QT.Entities.Data.LogTask log = Websosanh.Core.Common.BAL.ProtobufTool.DeSerialize <LogTask>(body);
            this.Invoke(new Action(() =>
            {
                try
                {
                    //Nhận 1 tin nhắn.
                    string str = log.EventLog;

                    string nameOfTab = log.EventLog;
                    if (!this.lstFrmLogForm.ContainsKey(nameOfTab))
                    {
                        XtraTabPage pageNew = new XtraTabPage();
                        pageNew.Text        = nameOfTab;
                        this.xtraTabContorl.TabPages.Add(pageNew);
                        var ucLogD = (new ucLog());
                        pageNew.Controls.Add(ucLogD);
                        ucLogD.Dock = DockStyle.Fill;
                        lstFrmLogForm.Add(nameOfTab, pageNew);
                    }
                    (this.lstFrmLogForm[nameOfTab].Controls[0] as ucLog).AddLog(log.Message);
                }
                catch (Exception ex)
                {
                }
            }));
        }
コード例 #2
0
        private void HandleJob(byte[] body, string fixName)
        {
            QT.Entities.Data.LogTask log = Websosanh.Core.Common.BAL.ProtobufTool.DeSerialize <LogTask>(body);

            if (fixName == "")
            {
                log.Company = "ALL";
            }
            if (fixName != "" && !Regex.IsMatch(log.Company, fixName))
            {
                return;
            }

            this.Invoke(new Action(() =>
            {
                try
                {
                    //Nhận 1 tin nhắn.
                    string str = log.Company;
                    if (!this.dicViewLog.ContainsKey(str))
                    {
                        FrmViewLog frmViewLog = new FrmViewLog();
                        frmViewLog.Text       = str;
                        frmViewLog.MdiParent  = this;
                        this.dicViewLog.Add(str, frmViewLog);
                    }
                    this.dicViewLog[str].ShowMessage(log);
                    this.dicViewLog[str].Show();
                }
                catch (Exception ex)
                {
                }
            }));
        }
コード例 #3
0
        private void HandleJob(byte[] body)
        {
            QT.Entities.Data.LogTask log = Websosanh.Core.Common.BAL.ProtobufTool.DeSerialize <LogTask>(body);
            this.Invoke(new Action(() =>
            {
                //Nhận 1 tin nhắn.
                string str = log.EventLog;
                switch (str)
                {
                case "eventProcessLink":
                    {
                        if (txteventProcessLink.TextLength > 100000)
                        {
                            txteventProcessLink.Text = "";
                        }
                        txteventProcessLink.AppendText(string.Format("\n{0}:{1}", log.Consumer, log.Message));
                    } break;

                case "eventWhenGetProductLink":
                    {
                        if (txteventWhenGetProductLink.TextLength > 100000)
                        {
                            txteventWhenGetProductLink.Text = "";
                        }
                        txteventWhenGetProductLink.AppendText(string.Format("\n{0}:{1}", log.Consumer, log.Message));
                    } break;

                case "eventWhenAddQueue":
                    {
                        if (txteventWhenAddQueue.TextLength > 100000)
                        {
                            txteventWhenAddQueue.Text = "";
                        }
                        txteventWhenAddQueue.AppendText(string.Format("\n{0}:{1}", log.Consumer, log.Message));
                    } break;

                default:
                    {
                        if (txtOtherMss.TextLength > 100000)
                        {
                            txtOtherMss.Text = "";
                        }
                        txtOtherMss.AppendText(string.Format("\n{0}:{1}:{2}", log.Consumer, log.Message, log.EventLog));
                    } break;
                }
            }));
        }