當前位置: 首頁>>代碼示例>>C#>>正文


C# MessageBuilder.AppendHtmlMessage方法代碼示例

本文整理匯總了C#中Smuxi.Engine.MessageBuilder.AppendHtmlMessage方法的典型用法代碼示例。如果您正苦於以下問題:C# MessageBuilder.AppendHtmlMessage方法的具體用法?C# MessageBuilder.AppendHtmlMessage怎麽用?C# MessageBuilder.AppendHtmlMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Smuxi.Engine.MessageBuilder的用法示例。


在下文中一共展示了MessageBuilder.AppendHtmlMessage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AppendHtmlMessageCssFgRed

        public void AppendHtmlMessageCssFgRed()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            var textPart = builder.CreateText("Test");
            textPart.ForegroundColor = new TextColor(255, 0, 0);
            builder.Append(textPart);
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendHtmlMessage("<div style=\"color: #FF0000\">Test</div>");
            var actualMsg = builder.ToMessage();
            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:oli-obk,項目名稱:smuxi,代碼行數:15,代碼來源:MessageBuilderTests.cs

示例2: AppendHtmlMessageBold

        public void AppendHtmlMessageBold()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            var textPart = builder.CreateText("Test");
            textPart.Bold = true;
            builder.Append(textPart);
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendHtmlMessage("<b>Test</b>");
            var actualMsg = builder.ToMessage();
            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:oli-obk,項目名稱:smuxi,代碼行數:15,代碼來源:MessageBuilderTests.cs

示例3: AppendHtmlMessageCssFgRedBgBlue

        public void AppendHtmlMessageCssFgRedBgBlue()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            var textPart = builder.CreateText("Test");
            textPart.ForegroundColor = new TextColor(255, 0, 0);
            textPart.BackgroundColor = new TextColor(0, 0, 255);
            builder.Append(textPart);
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendHtmlMessage(
                "<div style=\"" +
                    "color: #FF0000; " +
                    "background: #0000FF url('smiley.gif') no-repeat fixed center" +
                "\">Test</div>");
            var actualMsg = builder.ToMessage();
            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:oli-obk,項目名稱:smuxi,代碼行數:20,代碼來源:MessageBuilderTests.cs

示例4: AppendHtmlUrlMessage

        public void AppendHtmlUrlMessage()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            string html = @"<a href=""url"">urltext</a>";
            builder.AppendHtmlMessage(html);
            var actualMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendUrl("url", "urltext");

            var expectedMsg = builder.ToMessage();
            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:glwu,項目名稱:smuxi,代碼行數:15,代碼來源:MessageBuilderTests.cs

示例5: AppendHtmlMessageWithNewlines

        public void AppendHtmlMessageWithNewlines()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            string html = "<p>TextA\nTextB<p>\nTextC</p>\n</p>";
            builder.AppendHtmlMessage(html);
            var actualMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("TextA");
            builder.AppendSpace();
            builder.AppendText("TextB");
            builder.AppendSpace();
            builder.AppendText("TextC");

            var expectedMsg = builder.ToMessage();
            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:glwu,項目名稱:smuxi,代碼行數:19,代碼來源:MessageBuilderTests.cs


注:本文中的Smuxi.Engine.MessageBuilder.AppendHtmlMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。