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


C# MessageBuilder.AppendUrl方法代碼示例

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


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

示例1: BenchmarkLowerBound

 public void BenchmarkLowerBound()
 {
     int howOften = 5000;
     var nonurl = @"is this up to date? --> ";
     var url = @"http://www.stack.nl/~jilles/irc/atheme-help/";
     var withUrl = nonurl + url;
     var withoutUrl = @"Generated Sat Dec 11 21:29:16 CET 2010 -- old";
     var builder = new MessageBuilder();
     for (int i = 0; i < howOften; ++i) {
         builder.AppendText(nonurl);
         builder.AppendUrl(url);
     }
 }
開發者ID:pacificIT,項目名稱:smuxi,代碼行數:13,代碼來源:MessageParserTests.cs

示例2: ParseUrlsSimple

        public void ParseUrlsSimple()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendUrl("http://example.com");
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("http://example.com");
            var actualMsg = builder.ToMessage();
            MessageParser.ParseUrls(actualMsg);

            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:grendello,項目名稱:smuxi,代碼行數:15,代碼來源:MessageParserTests.cs

示例3: ParseUrlsBrackets

        public void ParseUrlsBrackets()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("foo <");
            builder.AppendUrl("http://example.com");
            builder.AppendText("> bar");
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendMessage("foo <http://example.com> bar");
            var actualMsg = builder.ToMessage();

            Assert.AreEqual(expectedMsg, actualMsg);
        }
開發者ID:pacificIT,項目名稱:smuxi,代碼行數:16,代碼來源:MessageParserTests.cs

示例4: CopyConstructor

        public void CopyConstructor()
        {
            var builder = new MessageBuilder();
            builder.AppendEventPrefix();
            builder.AppendUrl("http://example.com");
            builder.AppendText("foobar");
            var msg = builder.ToMessage();
            var copiedMsg = new MessageModel(msg);

            Assert.AreNotSame(msg, copiedMsg);
            Assert.IsNotNull(copiedMsg.MessageParts);
            Assert.AreNotSame(msg.MessageParts, copiedMsg.MessageParts);
            Assert.AreEqual(msg, copiedMsg);
        }
開發者ID:Jaykul,項目名稱:smuxi,代碼行數:14,代碼來源:MessageModelTests.cs

示例5: CommandGenerateMessages

        public void CommandGenerateMessages(CommandModel cmd, IChatView chat)
        {
            Trace.Call(cmd, chat);

            var count = 0;
            Int32.TryParse(cmd.Parameter, out count);

            var builder = new MessageBuilder();
            var sender = new ContactModel("msg-tester", "msg-tester", "test", "test");
            builder.AppendMessage(sender, "time for a messsage generator command so I can test speed and memory usage");
            var text = builder.CreateText(" *formatted text* ");
            text.Bold = true;
            builder.Append(text);
            builder.AppendUrl("https://www.smuxi.org/");

            var msgs = new List<MessageModel>(count);
            for (var i = 0; i < count; i++) {
                var msg = builder.ToMessage();
                msgs.Add(msg);
            }

            DateTime start, stop;
            start = DateTime.UtcNow;
            foreach (var msg in msgs) {
                chat.AddMessage(msg);
            }
            stop = DateTime.UtcNow;

            builder = new MessageBuilder();
            builder.AppendText(
                "IChatView.AddMessage(): count: {0} took: {1:0} ms avg: {2:0.00} ms",
                count,
                (stop - start).TotalMilliseconds,
                (stop - start).TotalMilliseconds / count
            );
            chat.AddMessage(builder.ToMessage());
        }
開發者ID:johansson,項目名稱:smuxi,代碼行數:37,代碼來源:CommandManager.cs

示例6: SetUp

        public void SetUp()
        {
            JsConfig<MessagePartModel>.ExcludeTypeInfo = true;

            var builder = new MessageBuilder();
            builder.AppendSenderPrefix(
                new ContactModel("meeebey", "meebey", "netid", "netprot")
            );
            builder.AppendText("solange eine message aber keine url hat ist der vorteil nur gering (wenn ueberhaupt)");
            SimpleMessage = builder.ToMessage();
            SimpleMessageJson = JsonSerializer.SerializeToString(SimpleMessage);
            SimpleMessageDtoV1 = JsonSerializer.DeserializeFromString<MessageDtoModelV1>(SimpleMessageJson);

            var topic = "Smuxi the IRC client for sophisticated users: http://smuxi.org/ | Smuxi 0.7.2.2 'Lovegood' released (2010-07-27) http://bit.ly/9nvsZF | FAQ: http://smuxi.org/faq/ | Deutsch? -> #smuxi.de | Español? -> #smuxi.es | Smuxi @ FOSDEM 2010 talk: http://bit.ly/anHJfm";
            builder = new MessageBuilder();
            builder.AppendMessage(topic);
            builder.AppendText(" ");
            builder.AppendUrl("https://www.smuxi.org/issues/show/428", "smuxi#428");
            ComplexMessage = builder.ToMessage();
            ComplexMessageJson = JsonSerializer.SerializeToString(ComplexMessage);
            ComplexMessageDtoV1 = JsonSerializer.DeserializeFromString<MessageDtoModelV1>(ComplexMessageJson);
        }
開發者ID:NattyNarwhal,項目名稱:smuxi,代碼行數:22,代碼來源:MessageDtoModelV1Tests.cs

示例7: 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


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