コード例 #1
0
        private void consumer_Listener(IMessage message)
        {
            String strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            try
            {
                ITextMessage msg = (ITextMessage)message;

                lock (lockArea)
                {
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(msg.Text);
                    if (IRAPXMLUtils.GetXMLNodeAttributeValue(doc.FirstChild.FirstChild.FirstChild, "Type") == MessageType.Commom.ToString())
                    {
                        CommonMessage Commonmsg = new CommonMessage();
                        IRAPXMLUtils.LoadValueFromXMLNode(doc.FirstChild.FirstChild.FirstChild, Commonmsg);
                        Helper.Instance.ShowPupUp("消息", Commonmsg.FromID, Commonmsg.Content);
                        Thread.Sleep(1000);
                        WaitingMessages.Add(Commonmsg);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public override XmlDocument GenerateSendXml(XmlDocument doc)
        {
            XmlNode n = IRAPXMLUtils.GenerateXMLAttribute(doc.FirstChild.FirstChild.FirstChild, this);

            doc.FirstChild.FirstChild.RemoveAll();
            doc.FirstChild.FirstChild.AppendChild(n);
            return(doc);
        }