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


C# StringBuilder.AppendAttribute方法代码示例

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


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

示例1: appendPromoter

		void appendPromoter(StringBuilder sb, Promoter p, bool doneOne)
		{
			if (doneOne)
				sb.Append(", ");
			sb.Append(p.Link());
			if (p.SalesUsrK > 0)
			{
				sb.Append(" (");
				sb.Append(p.SalesUsr.NickName);
				sb.Append(")");
			}
			sb.Append(" ");
			sb.Append("<a");
			sb.AppendAttribute("href", p.Url("callnow", "true"));
			sb.AppendAttribute("target", "_blank");
			sb.Append(">");
			sb.Append(p.PhoneNumber);
			sb.Append("</a>");
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:19,代码来源:EventsWithNoSpendPromoters.ascx.cs

示例2: Page_Load

		protected void Page_Load(object sender, EventArgs e)
		{
			List<Usr> onlineUsrs = Usr.GetOnlineUsers().ToList();

			if (Usr.Current != null && !onlineUsrs.Exists(u => u.K == Usr.Current.K))
			{
				onlineUsrs.Add(Usr.Current);
				onlineUsrs.Sort(new UsrNickNameComparer());
			}
			OnlineLabel.Text = onlineUsrs.Count.ToString() + " member" + (onlineUsrs.Count == 1 ? "" : "s") + " online:";

			OnlineDataList.Visible = false;
			StringBuilder sb = new StringBuilder();
			bool doneOne = false;
			foreach (Usr u in onlineUsrs)
			{
				bool isBuddy = Usr.Current != null && Usr.Current.IsBuddy(u);

				if (doneOne)
					sb.Append(", ");

				sb.Append("<a");
				sb.AppendAttribute("href", u.Url());
				u.RolloverAppend(sb);
				sb.Append(">");

				if (isBuddy)
					sb.Append("<b>");

				sb.Append(u.NickName);

				if (isBuddy)
					sb.Append("</b>");

				sb.Append("</a>");

				//if (u.ChattingNow)
				//	u.PresenceIconAppend(sb, "selected-onyellow");

				//if (Usr.Current != null && u.K != Usr.Current.K)
				//{
				//    Chat.RoomSpec r = new Chat.RoomSpec(u.K, Usr.Current.K);
				//    r.PinHtmlAppend(sb, "selected-onyellow");
				//}
				doneOne = true;
			}
			OnlineP.InnerHtml = sb.ToString();
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:48,代码来源:Online.ascx.cs

示例3: PresenceIconAppend

		public void PresenceIconAppend(StringBuilder sb, string shading)
		{
			if (ChattingNow || LoggedInNow)
			{
				sb.Append("<img");
				sb.AppendAttribute("src", ChattingNow ? "/gfx/chat-chatting.png" : "/gfx/chat-online.png");
				sb.AppendAttribute("border", "0");
				sb.AppendAttribute("width", ChattingNow ? "13" : "9");
				sb.AppendAttribute("height", "11");
				sb.AppendAttribute("onmouseover", ChattingNow ? "sttd(4);" : "sttd(3);");
				sb.AppendAttribute("onmouseout", "htm();");
				sb.AppendAttribute("class", "ChatClientRoomPresence");
				sb.Append(" />");
			}
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:15,代码来源:Usr.cs

示例4: RolloverAppend

		public void RolloverAppend(StringBuilder sb)
		{
			sb.Append(" onmouseover=\"");
			mouseOverTextAppend(sb);
			sb.Append("\"");
			sb.AppendAttribute("onmouseout", "htm();");
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:7,代码来源:Usr.cs

示例5: LinkAppend

		public void LinkAppend(StringBuilder sb, bool newWindow, params string[] par)
		{
			sb.Append("<a");
			sb.AppendAttribute("href", Url(par));
			sb.Append(" ");
			RolloverAppend(sb);
			if (newWindow)
				sb.AppendAttribute("target", "_blank");
			sb.Append(">");
			sb.Append(NickNameDisplay);
			sb.Append("</a>");
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:12,代码来源:Usr.cs

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


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