Exemple #1
0
        public override string ToString()
        {
            string output = string.Format(
                "Host: {0}\r\n" +
                "Application: {1}\r\n" +
                "Message type: {2}\r\n" +
                "Server: {3}\r\n" +
                "Time: {4}\r\n" +
                "URI: {5}\r\n" +
                "Adapter: {6}\r\n",
                Host,
                Application,
                MessageType,
                PublishingServer,
                SuspendTime.ToString("yyyy-MM-dd HH:mm:ss"),
                Uri,
                Adapter);

            if (Adapter == "FILE")
            {
                output += string.Format("File name: {0}\r\n", MsgPath);
            }
            output += "Additional info: " + AdditionalInfo;
            return(output);
        }
Exemple #2
0
        public string ToString(bool useHtml = false)
        {
            string output;

            if (useHtml)
            {
                output = string.Format(
                    "<b>Host:</b> {0}<br />" +
                    "<b>Application:</b> {1}<br />" +
                    "<b>Message type:</b> {2}<br />" +
                    "<b>Server:</b> {3}<br />" +
                    "<b>Time:</b> {4}<br />" +
                    "<b>URI:</b> {5}<br />" +
                    "<b>Adapter:</b> {6}<br />",
                    Host,
                    Application,
                    MessageType,
                    PublishingServer,
                    SuspendTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    Uri,
                    Adapter);
                if (Adapter == "FILE")
                {
                    output += string.Format("<b>File name:</b> {0}<br />", MsgPath);
                }
                output += "<b>Additional info:</b><blockquote>" + AdditionalInfo + "<hr /></blockquote>";
            }
            else
            {
                output = string.Format(
                    "Host: {0}\r\n" +
                    "Application: {1}\r\n" +
                    "Message type: {2}\r\n" +
                    "Server: {3}\r\n" +
                    "Time: {4}\r\n" +
                    "URI: {5}\r\n" +
                    "Adapter: {6}\r\n",
                    Host,
                    Application,
                    MessageType,
                    PublishingServer,
                    SuspendTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    Uri,
                    Adapter);
                if (Adapter == "FILE")
                {
                    output += string.Format("File name: {0}\r\n", MsgPath);
                }
                output += "Additional info: " + AdditionalInfo;
            }
            return(output);
        }