本文整理汇总了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>");
}
示例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();
}
示例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(" />");
}
}
示例4: RolloverAppend
public void RolloverAppend(StringBuilder sb)
{
sb.Append(" onmouseover=\"");
mouseOverTextAppend(sb);
sb.Append("\"");
sb.AppendAttribute("onmouseout", "htm();");
}
示例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>");
}
示例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>");
//.........这里部分代码省略.........