本文整理汇总了C#中Smuxi.Engine.MessageBuilder.Append方法的典型用法代码示例。如果您正苦于以下问题:C# MessageBuilder.Append方法的具体用法?C# MessageBuilder.Append怎么用?C# MessageBuilder.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smuxi.Engine.MessageBuilder
的用法示例。
在下文中一共展示了MessageBuilder.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendBrokenMail
public void AppendBrokenMail()
{
var msg = "mailto:/[email protected]";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("mailto:/"));
builder.Append(new UrlMessagePartModel("mailto:[email protected]", "[email protected]"));
TestMessage(msg, builder.ToMessage());
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: BrokenAppendMessageWithNonUrls
public void BrokenAppendMessageWithNonUrls()
{
var msg = "org.gnome.Foo.desktop";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("org.gnome.Foo.desktop"));
TestMessage(msg, builder.ToMessage());
msg = "ServiceStack.Common";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("ServiceStack.Common"));
TestMessage(msg, builder.ToMessage());
}
示例6: AppendTextUrlParsingUrlNoProtocol
public void AppendTextUrlParsingUrlNoProtocol()
{
var msg = @"hey look at this: test.org";
var url = @"http://test.org";
var urltext = @"test.org";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("hey look at this: "));
builder.Append(new UrlMessagePartModel(url, urltext));
TestMessage(msg, builder.ToMessage());
}
示例7: AppendTextUrlSquareBrackets
public void AppendTextUrlSquareBrackets()
{
var msg = @"[372 (Motd)] - FOSSCON [http://www.fosscon.org] and fossevents ";
var url = @"http://www.fosscon.org";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("[372 (Motd)] - FOSSCON ["));
builder.Append(new UrlMessagePartModel(url));
builder.Append(new TextMessagePartModel("] and fossevents "));
TestMessage(msg, builder.ToMessage());
}
示例8: AppendTextUrlParsingUrlEndsInComma
public void AppendTextUrlParsingUrlEndsInComma()
{
var msg = @"hey look at this: http://test.org, it is really cool";
var url = @"http://test.org";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("hey look at this: "));
builder.Append(new UrlMessagePartModel(url));
builder.Append(new TextMessagePartModel(", it is really cool"));
TestMessage(msg, builder.ToMessage());
}
示例9: AppendTextUrlParsingUrlInBrackets
public void AppendTextUrlParsingUrlInBrackets()
{
var msg = @"my homepage (http://mine.my) has nothing on it";
var url = @"http://mine.my";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("my homepage ("));
builder.Append(new UrlMessagePartModel(url));
builder.Append(new TextMessagePartModel(") has nothing on it"));
TestMessage(msg, builder.ToMessage());
}
示例10: AppendMessageWithOddUrls
public void AppendMessageWithOddUrls()
{
var msg = @"zack: http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob;f=checks/source-copyright.desc;h=3276a57e81b1c8c38073e667221e262df1a606c0;hb=167170d7911473a726f7e77008d8b2246a6822e8";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("zack: "));
builder.Append(new UrlMessagePartModel("http://anonscm.debian.org/gitweb/?p=lintian/lintian.git;a=blob;f=checks/source-copyright.desc;h=3276a57e81b1c8c38073e667221e262df1a606c0;hb=167170d7911473a726f7e77008d8b2246a6822e8"));
TestMessage(msg, builder.ToMessage());
msg = "http://sources.debian.net/src/kfreebsd-10/10.0~svn259778-1/sys/cddl/dev/dtrace/dtrace_anon.c";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://sources.debian.net/src/kfreebsd-10/10.0~svn259778-1/sys/cddl/dev/dtrace/dtrace_anon.c"));
TestMessage(msg, builder.ToMessage());
msg = "http://www.stack.nl/~jilles/cgi-bin/hgwebdir.cgi/charybdis/raw-rev/9d769851c1c7";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://www.stack.nl/~jilles/cgi-bin/hgwebdir.cgi/charybdis/raw-rev/9d769851c1c7"));
TestMessage(msg, builder.ToMessage());
msg = "<RAOF> meebey: Associated mono branch is master-experimental in git+ssh://git.debian.org/~/public_git/mono.git";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("<RAOF> meebey: Associated mono branch is master-experimental in "));
builder.Append(new UrlMessagePartModel("git+ssh://git.debian.org/~/public_git/mono.git"));
TestMessage(msg, builder.ToMessage());
msg = "<knocte> meebey: does this URL highlight ok with latest master? https://groups.google.com/forum/#!topic/fsharp-opensource/KLejo_vw5R4";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("<knocte> meebey: does this URL highlight ok with latest master? "));
builder.Append(new UrlMessagePartModel("https://groups.google.com/forum/#!topic/fsharp-opensource/KLejo_vw5R4"));
TestMessage(msg, builder.ToMessage());
msg = "<astronouth7303> found another bad URL: http://www.flickr.com/photos/[email protected]/12000715226/in/photostream/";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("<astronouth7303> found another bad URL: "));
builder.Append(new UrlMessagePartModel("http://www.flickr.com/photos/[email protected]/12000715226/in/photostream/"));
TestMessage(msg, builder.ToMessage());
msg = "http://en.wikipedia.org/Talk:Main_Page";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://en.wikipedia.org/Talk:Main_Page"));
TestMessage(msg, builder.ToMessage());
msg = "http://en.wikipedia.org/wiki/Godunov's_scheme";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://en.wikipedia.org/wiki/Godunov's_scheme"));
TestMessage(msg, builder.ToMessage());
msg = "<astronouth7303> ok, this is just trippy URL matching: http://couchdb.local/mydb/_magic";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("<astronouth7303> ok, this is just trippy URL matching: "));
builder.Append(new UrlMessagePartModel("http://couchdb.local/mydb/_magic"));
TestMessage(msg, builder.ToMessage());
msg = "https://web.archive.org/web/20050208144213/http://www.jaganelli.de/";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("https://web.archive.org/web/20050208144213/http://www.jaganelli.de/"));
TestMessage(msg, builder.ToMessage());
msg = "irc://freenode/smuxi";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
msg = "http://www.test.de/bilder.html?data[meta_id]=13895&data[bild_id]=7";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://www.test.de/bilder.html?data[meta_id]=13895&data[bild_id]=7"));
TestMessage(msg, builder.ToMessage());
msg = "https://eu.api.soyoustart.com/console/#/order/dedicated/server/{serviceName}#GET";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
}
示例11: AppendTextUrlParsingSanity
public void AppendTextUrlParsingSanity()
{
var msg = @"http://ab.cd.ef.de-hlub.gummi.museum/my_script%20windows.php?test=blub&blar=93";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
/*
var msg = @"<http://smuxi.im/#sometag>";
var msg = @"hey look at this: http://test.org, it is really cool";
var msg = @"have you recently looked at xkcd.org?";
var msg = @"my homepage (http://mine.my) has nothing on it";
var msg = @"[smuxi] meebey pushed 2 new commits to stable: https://github.com/meebey/smuxi/compare/153153feddd4...ff7d23a7550c";
var msg = @"[372 (Motd)] - FOSSCON [http://www.fosscon.org] and fossevents ";
var msg = @"[372 (Motd)] - page (http://freenode.net/policy.shtml). Thank you for usin";
var msg = @"look at all those deprecated fields pidgin still sets: <c xmlns=""http://jabber.org/protocol/caps"" hash=""sha-1"" node=""http://pidgin.im/"" ext=""voice-v1 camera-v1 video-v1"" ver=""AcN1/PEN8nq7AHD+9jpxMV4U6YM="" />";
var msg = @"16:04:11 <clonkspot> Glückwunsch! (@YouTube http://t.co/IXjWtfGJ5d)";
var msg = @"This is a http://sentence.that/ends.with?a. This is another sentence.";
*/
}
示例12: AppendIPv4Links
public void AppendIPv4Links()
{
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://127.0.0.1"));
TestMessage("http://127.0.0.1", builder.ToMessage());
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel("http://93.220.211.43:40000"));
TestMessage("http://93.220.211.43:40000", builder.ToMessage());
}
示例13: AppendMessageWithIdnLink
public void AppendMessageWithIdnLink()
{
var msg = "http://www.brasileirão.com";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
msg = "http://مثال.ايران/";
builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
}
示例14: AppendTextUrlGithubMessage
public void AppendTextUrlGithubMessage()
{
var msg = @"[smuxi] meebey pushed 2 new commits to stable: https://github.com/meebey/smuxi/compare/153153feddd4...ff7d23a7550c";
var url = @"https://github.com/meebey/smuxi/compare/153153feddd4...ff7d23a7550c";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("[smuxi] meebey pushed 2 new commits to stable: "));
builder.Append(new UrlMessagePartModel(url));
TestMessage(msg, builder.ToMessage());
}
示例15: AppendTextUrlMultipleInQuotes
public void AppendTextUrlMultipleInQuotes()
{
var msg = @"look at all those deprecated fields pidgin still sets: <c xmlns=""http://jabber.org/protocol/caps"" hash=""sha-1"" node=""http://pidgin.im/"" ext=""voice-v1 camera-v1 video-v1"" ver=""AcN1/PEN8nq7AHD+9jpxMV4U6YM="" />";
var builder = new MessageBuilder();
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel(@"look at all those deprecated fields pidgin still sets: <c xmlns="""));
builder.Append(new UrlMessagePartModel("http://jabber.org/protocol/caps"));
builder.Append(new TextMessagePartModel(@""" hash=""sha-1"" node="""));
builder.Append(new UrlMessagePartModel("http://pidgin.im/"));
builder.Append(new TextMessagePartModel(@""" ext=""voice-v1 camera-v1 video-v1"" ver=""AcN1/PEN8nq7AHD+9jpxMV4U6YM="" />"));
TestMessage(msg, builder.ToMessage());
}