当前位置: 首页>>代码示例>>C#>>正文


C# MessageBuilder.AppendText方法代码示例

本文整理汇总了C#中Smuxi.Engine.MessageBuilder.AppendText方法的典型用法代码示例。如果您正苦于以下问题:C# MessageBuilder.AppendText方法的具体用法?C# MessageBuilder.AppendText怎么用?C# MessageBuilder.AppendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Smuxi.Engine.MessageBuilder的用法示例。


在下文中一共展示了MessageBuilder.AppendText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

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

示例2: ParseUrlsParentheses

        public void ParseUrlsParentheses()
        {
            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.AppendText("foo (http://example.com) bar");
            var actualMsg = builder.ToMessage();
            MessageParser.ParseUrls(actualMsg);

            Assert.AreEqual(expectedMsg, actualMsg);
        }
开发者ID:grendello,项目名称:smuxi,代码行数:17,代码来源:MessageParserTests.cs

示例3: Contains

        public void Contains()
        {
            Assert.IsTrue(Buffer.Contains(TestMessages[0]));

            var msg = new MessageBuilder();
            msg.AppendText("testfoo");
            Assert.IsFalse(Buffer.Contains(msg.ToMessage()));
        }
开发者ID:grendello,项目名称:smuxi,代码行数:8,代码来源:MessageBufferTestsBase.cs

示例4: Add

        public void Add()
        {
            MessageBuilder msg = new MessageBuilder();
            msg.AppendText("test");

            int count = Buffer.Count;
            Buffer.Add(msg.ToMessage());
            Assert.AreEqual(count + 1, Buffer.Count);
        }
开发者ID:NattyNarwhal,项目名称:smuxi,代码行数:9,代码来源:MessageBufferTestsBase.cs

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

示例6: ImplicitRemoveAt

        public void ImplicitRemoveAt()
        {
            Buffer.MaxCapacity = 16;
            // generate 32 extra messsages to exceed the max capacity which
            // forces a RemoveAt() call of the oldest messages
            var bufferCount = Buffer.Count;
            var msgs = new List<MessageModel>(Buffer);
            for (int i = 1; i <= 32; i++) {
                var builder = new MessageBuilder();
                builder.AppendText("msg{0}", bufferCount + i);
                var msg = builder.ToMessage();
                msgs.Add(msg);
                Buffer.Add(msg);
            }

            Assert.AreEqual(Buffer.MaxCapacity, Buffer.Count);
            Assert.AreEqual(msgs[32 - (Buffer.MaxCapacity - bufferCount)].ToString(), Buffer[0].ToString());
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:18,代码来源:Db4oMessageBufferTests.cs

示例7: ImplicitFlush

        public void ImplicitFlush()
        {
            // generate 32 extra messsages to exceed the buffer size which
            // forces a flush of the buffer to db4o
            var bufferCount = Buffer.Count;
            var msgs = new List<MessageModel>(Buffer);
            for (int i = 1; i <= 32; i++) {
                var builder = new MessageBuilder();
                builder.AppendText("msg{0}", bufferCount + i);
                var msg = builder.ToMessage();
                msgs.Add(msg);
                Buffer.Add(msg);
            }

            int j = 0;
            foreach (var msg in Buffer) {
                Assert.AreEqual(msgs[j++].ToString(), msg.ToString());
            }
            Assert.AreEqual(msgs.Count, j);
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:20,代码来源:Db4oMessageBufferTests.cs

示例8: AppendFormatWithoutPlaceholders

        public void AppendFormatWithoutPlaceholders()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("I hope this works");
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendFormat("I hope this works");
            var actualMsg = builder.ToMessage();

            Assert.AreEqual(expectedMsg, actualMsg);
        }
开发者ID:RAOF,项目名称:smuxi,代码行数:14,代码来源:MessageBuilderTests.cs

示例9: CommandHelp

        void CommandHelp(CommandModel cmd)
        {
            var chatView = f_MainWindow.ChatViewManager.GetChat(cmd.Chat);
            var builder = new MessageBuilder();
            // TRANSLATOR: this line is used as a label / category for a
            // list of commands below
            builder.AppendHeader(_("Frontend Commands"));
            chatView.AddMessage(builder.ToMessage());

            string[] help = {
                "help",
                "window number",
                "exit",
            };

            foreach (string line in help) {
                builder = new MessageBuilder();
                builder.AppendEventPrefix();
                builder.AppendText(line);
                chatView.AddMessage(builder.ToMessage());
            }
        }
开发者ID:vith,项目名称:smuxi,代码行数:22,代码来源:Entry.cs

示例10: AppendFormatWithStrings

        public void AppendFormatWithStrings()
        {
            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("The quick brown fox jumps over the lazy dog.");
            var expectedMsg = builder.ToMessage();

            builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendFormat("The quick brown {0} jumps over the lazy {1}.", "fox", "dog");
            var actualMsg = builder.ToMessage();

            Assert.AreEqual(expectedMsg, actualMsg);
        }
开发者ID:RAOF,项目名称:smuxi,代码行数:14,代码来源:MessageBuilderTests.cs

示例11: SetUp

        public void SetUp()
        {
            Buffer = CreateBuffer();
            TestMessages = new List<MessageModel>();

            var builder = new MessageBuilder();
            builder.TimeStamp = DateTime.MinValue;
            builder.AppendText("msg1");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg2");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendErrorText("msg3");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg4");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg5");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg6");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg7");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg8");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg9");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg10");
            TestMessages.Add(builder.ToMessage());

            builder = new MessageBuilder();
            builder.AppendText("msg11");
            TestMessages.Add(builder.ToMessage());

            foreach (var msg in TestMessages) {
                Buffer.Add(msg);
            }

            builder = new MessageBuilder();
            builder.AppendIdendityName(
                new ContactModel("meeebey", "meebey", "netid", "netprot")
            );
            builder.AppendSpace();
            builder.AppendText("solange eine message aber keine url hat ist der vorteil nur gering (wenn ueberhaupt)");
            SimpleMessage = builder.ToMessage();
        }
开发者ID:NattyNarwhal,项目名称:smuxi,代码行数:62,代码来源:MessageBufferTestsBase.cs

示例12: UpdateChatState

 bool UpdateChatState()
 {
     if (IsDisposed) {
         return false;
     }
     if (IsComposing) {
         NumberOfTypingDots++;
         if (NumberOfTypingDots == 4) {
             NumberOfTypingDots = 0;
         }
     } else {
         NumberOfTypingDots--;
         if (NumberOfTypingDots <= 0) {
             // done
             DeleteOldChatState();
             ChatStateTimeoutRunning = false;
             return false;
         }
     }
     var builder = new MessageBuilder();
     builder.AppendText(new string('.', NumberOfTypingDots));
     AddChatState(builder.ToMessage());
     GLib.Timeout.Add(300, UpdateChatState);
     return false;
 }
开发者ID:RAOF,项目名称:smuxi,代码行数:25,代码来源:XmppPersonChatView.cs

示例13: FormatUpload

        void FormatUpload(MessageBuilder bld, PersonModel person, ChatModel chat, Message message)
        {
            // Figure out what the user uploaded, we need to issue another call for this
            var upload = Client.Get<UploadWrapper>(String.Format("/room/{0}/messages/{1}/upload.json", chat.ID, message.Id)).Upload;

            bld.AppendEventPrefix();
            bld.AppendIdendityName(person).AppendSpace();
            bld.AppendText(_("has uploaded '{0}' ({1} B) {2}"), upload.Name, upload.Byte_Size, upload.Full_Url);
        }
开发者ID:glwu,项目名称:smuxi,代码行数:9,代码来源:CampfireProtocolManager.cs

示例14: SetUp

        public void SetUp()
        {
            var builder = new MessageBuilder();
            builder.AppendIdendityName(
                new ContactModel("meeebey", "meebey", "netid", "netprot")
            );
            builder.AppendSpace();
            builder.AppendText("solange eine message aber keine url hat ist der vorteil nur gering (wenn ueberhaupt)");
            SimpleMessage = builder.ToMessage();

            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);
            ComplexMessage = builder.ToMessage();
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:15,代码来源:MessageModelTests.cs

示例15: CommandGenerateMessages

        void CommandGenerateMessages(CommandModel cmd)
        {
            var chat = ChatViewManager.CurrentChatView;
            _CommandManager.CommandGenerateMessages(cmd, chat);

            var builder = new MessageBuilder();
            builder.AppendText(
                "ChatView.AddMessage(): MessageTextTagTable.Size: {0}",
                chat.OutputMessageTextView.MessageTextTagTable.Size
            );
            chat.AddMessage(builder.ToMessage());
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:12,代码来源:Entry.cs


注:本文中的Smuxi.Engine.MessageBuilder.AppendText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。