本文整理汇总了C#中System.Web.UI.WebControls.Button.As方法的典型用法代码示例。如果您正苦于以下问题:C# Button.As方法的具体用法?C# Button.As怎么用?C# Button.As使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Button
的用法示例。
在下文中一共展示了Button.As方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayChange
//.........这里部分代码省略.........
HintsData.IsChangeInactive = true;
AddLabel(String.Format("<br>This review has been {0}.", (changeList.Stage == 2 ? "closed" : "deleted")));
return;
}
AddLabel("<h3>Vote so far</h3>");
TableGen.Table reviewerVote = new TableGen.Table(2) { CssClass = "CssChangeListVoteHistory" };
ActivePage.Controls.Add(reviewerVote);
var reviewerQuery = from rv in DataContext.Reviewers where rv.ChangeListId == cid select rv;
Reviewer[] reviewers = reviewerQuery.ToArray();
bool iAmAReviewer = false;
foreach (Reviewer reviewer in reviewers)
{
var row = reviewerVote.CreateRow();
reviewerVote.AddItem(row);
row[0].Text = reviewer.ReviewerAlias;
if (userName.EqualsIgnoreCase(reviewer.ReviewerAlias))
{
DropDownList list = new DropDownList() { ID = "verdictlist" };
row[1].Add(list);
list.Items.Add(new ListItem() { Text = "Needs work" });
list.Items.Add(new ListItem() { Text = "LGTM with minor tweaks" });
list.Items.Add(new ListItem() { Text = "LGTM" });
list.Items.Add(new ListItem() { Text = "Non-scoring comment" });
iAmAReviewer = true;
}
else if (!Page.IsPostBack)
{
Review review = GetLastReview(cid, reviewer.ReviewerAlias);
if (review == null)
{
row[1].Text = "Have not looked";
}
else
{
row[1].Add(new HyperLink()
{
Text = Malevich.Util.CommonUtils.ReviewStatusToString(review.OverallStatus),
NavigateUrl = Request.FilePath + "?rid=" + review.Id,
});
}
}
}
bool iOwnTheChange = changeList.UserName.EqualsIgnoreCase(userName);
if (!iAmAReviewer && !iOwnTheChange)
{
AddLabel("<br>");
AddLink("I would like to review this change.", "?cid=" + changeList.Id + "&action=makemereviewer")
.AppendCSSClass("button");
}
if (iOwnTheChange && changeList.Stage != 2 && /* 2 = closed */
GetChangeListStatus(changeList) == ChangeListStatus.Closable)
{
AddLabel("<br>");
AddLink("Close Review", "?cid=" + changeList.Id + "&action=close")
.AppendCSSClass("button");
}
if (iOwnTheChange)
{
HintsData.IsChangeAuthor = true;
AddLabel("<h3>My response</h3>");
}
else
{
HintsData.IsChangeReviewer = true;
AddLabel("<h3>My comments</h3>");
}
TextBox commentTextBox = new TextBox();
ActivePage.Controls.Add(commentTextBox);
commentTextBox.TextMode = TextBoxMode.MultiLine;
commentTextBox.AppendCSSClass("CssGeneralCommentInputBox");
commentTextBox.ID = "reviewcommenttextbox";
AddLabel("<br>");
Button submitReviewButton =
new Button() { ID = "submitreviewbutton", Text = "Submit", CssClass = "button" };
ActivePage.Controls.Add(submitReviewButton.As(HtmlTextWriterTag.P));
submitReviewButton.Click += new EventHandler(
delegate(object sender, EventArgs e) { submitReview_Clicked(cid, sender, e); });
AddLabel("<br>");
int myReviewId = GetBaseReviewId(userName, cid);
if (myReviewId == 0)
return;
DisplayReviewLineComments(myReviewId);
}