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


C# Usr.LinkAppend方法代码示例

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


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

示例1: GetMoreInfoHtml

			public string GetMoreInfoHtml()
			{

				StringBuilder sb = new StringBuilder();
				if (RoomType == RoomType.Normal && ObjectType == Model.Entities.ObjectType.None)
				{
					sb.Append("<p>This is the general chat room.</p>");
				}
				else if (RoomType == RoomType.PrivateChat)
				{
					if (Usr.Current == null || (Usr.Current.K != this.ObjectK && Usr.Current.K != this.SecondObjectK))
						sb.Append("<p>This is a private chat room.</p>");
					else
					{
						Usr otherUsr = new Usr(Usr.Current.K == this.ObjectK ? this.SecondObjectK : this.ObjectK);
						sb.Append("<p>This is a private chat room between you and ");
						otherUsr.LinkAppend(sb, false);
						sb.Append("</p>");

						if (otherUsr.HasPic)
						{
							sb.Append("<p>");
							{
								sb.Append("<a");
								sb.AppendAttribute("href", otherUsr.Url());
								sb.Append(">");
								{
									sb.Append("<img");
									sb.AppendAttribute("src", Storage.Path(otherUsr.Pic));
									sb.AppendAttribute("class", "BorderBlack All");
									sb.AppendAttribute("width", "100");
									sb.AppendAttribute("height", "100");
									sb.Append(otherUsr.RolloverNoPic);
									sb.Append(">");
								}
								sb.Append("</a>");
							}
							sb.Append("</p>");
						}

					}

					

				}
				else if (RoomType == RoomType.Normal)
				{
					sb.Append("<p>");
					//sb.Append(string.Format("This is {0} chat room.", this.ObjectType.ToString().PrefixWithAOrAn(false)));
					string s = "";
					switch (ObjectType)
					{
						case Model.Entities.ObjectType.Country: { s = "This is a country chat room."; break; }
						case Model.Entities.ObjectType.Place: { s = "This is a place chat room."; break; }
						case Model.Entities.ObjectType.Venue: { s = "This is a venue chat room."; break; }
						case Model.Entities.ObjectType.Event: { s = "This is an event chat room."; break; }
						case Model.Entities.ObjectType.Article: { s = "This is an article chat room. All chat in this room will be posted as comments in the main article topic."; break; }
						case Model.Entities.ObjectType.Group: { s = "This is a group chat room."; break; }
						case Model.Entities.ObjectType.Photo: { s = "This is a photo chat room. All chat in this room will be posted as comments in the main photo topic."; break; }
						case Model.Entities.ObjectType.Thread: { s = "This is a topic chat room. All chat in this room will be posted as comments in the topic."; break; }
						default: { s = ""; break; }
					}
					sb.Append(s);
					sb.Append("</p>");

					if ((this.ObjectBob is IPic && ((IPic)ObjectBob).HasPic) || ObjectType == Model.Entities.ObjectType.Photo)
					{
						sb.Append("<p>");
						if (this.ObjectBob is IPage)
						{
							sb.Append("<a");
							sb.AppendAttribute("href", ((IPage)ObjectBob).Url());
							sb.Append(">");
						}
						{
							sb.Append("<img");
							if (ObjectType == Model.Entities.ObjectType.Photo)
								sb.AppendAttribute("src", Storage.Path(((Photo)ObjectBob).Icon));
							else
								sb.AppendAttribute("src", Storage.Path(((IPic)ObjectBob).Pic));
							sb.AppendAttribute("class", "BorderBlack All");
							sb.AppendAttribute("width", "100");
							sb.AppendAttribute("height", "100");
							sb.Append(">");
						}
						if (this.ObjectBob is IPage)
						{
							sb.Append("</a>");
						}
						sb.Append("</p>");
					}
					if (ObjectBob is IPage && ObjectBob is IReadableReference)
					{
						sb.Append("<p>");
						{
							sb.Append("<a");
							sb.AppendAttribute("href", ((IPage)ObjectBob).Url());
							sb.Append(">");
							sb.Append(((IReadableReference)ObjectBob).ReadableReference);
							sb.Append("</a>");
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Chat.cs


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