本文整理汇总了C#中System.Web.UI.WebControls.TableCell.RenderControl方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.RenderControl方法的具体用法?C# TableCell.RenderControl怎么用?C# TableCell.RenderControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.TableCell
的用法示例。
在下文中一共展示了TableCell.RenderControl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderErrorMessage
private void RenderErrorMessage(HtmlTextWriter writer)
{
if (this._displayErrorMessage)
{
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
TableCell cell = new TableCell();
cell.ApplyStyle(base.ErrorStyle);
cell.Text = this.NewConnectionErrorMessage;
cell.RenderControl(writer);
writer.RenderEndTag();
}
}
示例2: RenderErrorMessage
private void RenderErrorMessage(HtmlTextWriter writer) {
if (_displayErrorMessage) {
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
TableCell td = new TableCell();
td.ApplyStyle(ErrorStyle);
td.Text = NewConnectionErrorMessage;
td.RenderControl(writer);
writer.RenderEndTag();
}
}
示例3: WriteDay
void WriteDay (DateTime date, HtmlTextWriter writer)
{
TableItemStyle style = new TableItemStyle ();
TableCell cell = new TableCell ();
CalendarDay day = new CalendarDay (date,
IsWeekEnd (date.DayOfWeek),
date == TodaysDate, SelectedDates.Contains (date),
GetGlobalCalendar ().GetMonth (DisplayDate) != GetGlobalCalendar ().GetMonth (date),
date.Day.ToString ());
day.IsSelectable = SelectionMode != CalendarSelectionMode.None;
cell.HorizontalAlign = HorizontalAlign.Center;
cell.Width = Unit.Percentage (GetCellWidth ());
LiteralControl lit = new LiteralControl (day.DayNumberText);
cell.Controls.Add (lit);
OnDayRender (cell, day);
if (dayStyle != null && !dayStyle.IsEmpty) {
style.CopyFrom (dayStyle);
}
if (day.IsWeekend && weekendDayStyle != null && !weekendDayStyle.IsEmpty) {
style.CopyFrom (weekendDayStyle);
}
if (day.IsToday && todayDayStyle != null && !todayDayStyle.IsEmpty) {
style.CopyFrom (todayDayStyle);
}
if (day.IsOtherMonth && otherMonthDayStyle != null && !otherMonthDayStyle.IsEmpty) {
style.CopyFrom (otherMonthDayStyle);
}
if (day.IsSelected && Enabled) {
style.BackColor = Color.Silver;
style.ForeColor = Color.White;
if (selectedDayStyle != null && !selectedDayStyle.IsEmpty) {
style.CopyFrom (selectedDayStyle);
}
}
cell.ApplyStyle (style);
lit.Text = BuildLink (GetDaysFromZenith (date).ToString (), day.DayNumberText,
cell.ForeColor, day.IsSelectable && Enabled);
cell.RenderControl (writer);
}
示例4: RenderDays
//.........这里部分代码省略.........
}
this.RenderCalendarCell(writer, style, selectWeekText, title, buttonsActive, eventArgument);
}
for (int j = 0; j < 7; j++)
{
string str4;
if (num4 > 0)
{
j += num4;
while (num4 > 0)
{
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.RenderEndTag();
num4--;
}
}
else if (flag6)
{
while (j < 7)
{
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.RenderEndTag();
j++;
}
break;
}
int dayOfWeek = (int) this.threadCalendar.GetDayOfWeek(time);
int dayOfMonth = this.threadCalendar.GetDayOfMonth(time);
if ((dayOfMonth <= 0x1f) && flag2)
{
str4 = cachedNumbers[dayOfMonth];
}
else
{
str4 = time.ToString("dd", CultureInfo.CurrentCulture);
}
CalendarDay day = new CalendarDay(time, (dayOfWeek == 0) || (dayOfWeek == 6), time.Equals(todaysDate), (this.selectedDates != null) && this.selectedDates.Contains(time), this.threadCalendar.GetMonth(time) != month, str4);
int num12 = 0x10;
if (day.IsSelected)
{
num12 |= 8;
}
if (day.IsOtherMonth)
{
num12 |= 2;
}
if (day.IsToday)
{
num12 |= 4;
}
if (day.IsWeekend)
{
num12 |= 1;
}
int styleMask = definedStyleMask & num12;
int index = styleMask & 15;
TableItemStyle style2 = styleArray[index];
if (style2 == null)
{
style2 = new TableItemStyle();
this.SetDayStyles(style2, styleMask, unit);
styleArray[index] = style2;
}
string str5 = null;
if (useAccessibleHeader)
{
str5 = time.ToString("m", CultureInfo.CurrentCulture);
}
if (flag3)
{
TableCell cell = new TableCell();
cell.ApplyStyle(style2);
LiteralControl child = new LiteralControl(str4);
cell.Controls.Add(child);
day.IsSelectable = hasButton;
this.OnDayRender(cell, day);
child.Text = this.GetCalendarButtonText(days.ToString(CultureInfo.InvariantCulture), str4, str5, buttonsActive && day.IsSelectable, cell.ForeColor);
cell.RenderControl(writer);
}
else
{
if (flag5 && style2.ForeColor.IsEmpty)
{
style2.ForeColor = this.defaultForeColor;
}
this.RenderCalendarCell(writer, style2, str4, str5, hasButton, days.ToString(CultureInfo.InvariantCulture));
}
if ((flag7 && (time.Month == this.maxSupportedDate.Month)) && (time.Day == this.maxSupportedDate.Day))
{
flag6 = true;
}
else
{
time = this.threadCalendar.AddDays(time, 1);
days++;
}
}
writer.Write("</tr>");
}
}
示例5: RenderAllDays
//.........这里部分代码省略.........
if (isWeekMode) {
weeksStyle = new TableItemStyle ();
weeksStyle.Width = Unit.Percentage (12);
weeksStyle.HorizontalAlign = HorizontalAlign.Center;
weeksStyle.CopyFrom (SelectorStyle);
size = Unit.Percentage (12);
} else {
size = Unit.Percentage (14);
}
TableItemStyle [] styles = new TableItemStyle [32];
int definedStyles = MASK_SELECTED;
if (weekendStyle != null && !weekendStyle.IsEmpty)
definedStyles |= MASK_WEEKEND;
if (otherMonthStyle != null && !otherMonthStyle.IsEmpty)
definedStyles |= MASK_OMONTH;
if (todayDayStyle != null && !todayDayStyle.IsEmpty)
definedStyles |= MASK_TODAY;
if (dayStyle != null && !dayStyle.IsEmpty)
definedStyles |= MASK_DAY;
int month = globCal.GetMonth (activeDate);
DateTime currentDay = firstDay;
int begin = (int) (firstDay - begin_date).TotalDays;
for (int crr = 0; crr < 6; crr++) {
writer.Write ("<tr>");
if (isWeekMode) {
int week_offset = begin + crr * 7;
string cellText = GetCalendarLinkText (
"R" + week_offset + "07",
SelectWeekText,
"Select week " + (crr + 1),
weeksCell.ForeColor,
isActive);
weeksCell.Text = cellText;
weeksCell.ApplyStyle (weeksStyle);
RenderCalendarCell (writer, weeksCell, cellText);
}
for (int weekDay = 0; weekDay < 7; weekDay++) {
string dayString = currentDay.Day.ToString ();
DayOfWeek dow = currentDay.DayOfWeek;
CalendarDay calDay =
new CalendarDay (
currentDay,
dow == DayOfWeek.Sunday ||
dow == DayOfWeek.Saturday,
currentDay == TodaysDate,
SelectedDates.Contains (currentDay),
globCal.GetMonth (currentDay) != month,
dayString
);
int dayStyles = GetMask (calDay) & definedStyles;
TableItemStyle currentDayStyle = styles [dayStyles];
if (currentDayStyle == null) {
currentDayStyle = new TableItemStyle ();
if ((dayStyles & MASK_DAY) != 0)
currentDayStyle.CopyFrom (DayStyle);
if ((dayStyles & MASK_WEEKEND) != 0)
currentDayStyle.CopyFrom (WeekendDayStyle);
if ((dayStyles & MASK_TODAY) != 0)
currentDayStyle.CopyFrom (TodayDayStyle);
if ((dayStyles & MASK_OMONTH) != 0)
currentDayStyle.CopyFrom (OtherMonthDayStyle);
if ((dayStyles & MASK_SELECTED) != 0) {
currentDayStyle.ForeColor = Color.White;
currentDayStyle.BackColor = Color.Silver;
currentDayStyle.CopyFrom (SelectedDayStyle);
}
currentDayStyle.Width = size;
currentDayStyle.HorizontalAlign = HorizontalAlign.Center;
}
TableCell dayCell = new TableCell ();
dayCell.ApplyStyle (currentDayStyle);
LiteralControl number = new LiteralControl (dayString);
dayCell.Controls.Add (number);
calDay.IsSelectable = isActive;
OnDayRender (dayCell, calDay);
if (calDay.IsSelectable)
number.Text = GetCalendarLinkText ((begin + (crr * 7 + weekDay)).ToString (),
dayString,
currentDay.ToShortDateString (),
dayCell.ForeColor,
isActive);
dayCell.RenderControl (writer);
currentDay = globCal.AddDays (currentDay, 1);
}
writer.Write("</tr>");
}
}
示例6: RenderItemCell
/// <summary>
/// Renders a table cell of a given toolbar item.
/// </summary>
/// <param name="item">Item to be rendered.</param>
/// <param name="writer">Writer that streams output to the client.</param>
protected void RenderItemCell(ToolbarItem item, HtmlTextWriter writer)
{
TableCell cell = new TableCell();
cell.HorizontalAlign = item.HorizontalAlign;
cell.VerticalAlign = item.VerticalAlign;
if (item is ToolbarSeparator)
{
//set separator height (custom if set or toolbar property)
if (this.Orientation == ToolbarOrientation.Horizontal)
//set the cell width on a horizontal toolbar
cell.Width = item.ItemCellDistance == Unit.Empty ? this.SeparatorCellDistance : item.ItemCellDistance;
else
//set the cell height on a vertical toolbar
cell.Height = item.ItemCellDistance == Unit.Empty ? this.SeparatorCellDistance : item.ItemCellDistance;
if (this.SeparatorImageUrl != String.Empty)
{
Image img = new Image();
img.ImageUrl = this.SeparatorImageUrl;
cell.Controls.Add(img);
}
else
{
cell.Text = " ";
}
cell.RenderControl(writer);
}
else
{
if (this.Orientation == ToolbarOrientation.Horizontal)
//set the cell width on a horizontal toolbar
cell.Width = item.ItemCellDistance == Unit.Empty ? this.ItemCellDistance : item.ItemCellDistance;
else
//set the cell height on a vertical toolbar
cell.Height = item.ItemCellDistance == Unit.Empty ? this.ItemCellDistance : item.ItemCellDistance;
//render the item
cell.RenderBeginTag(writer);
item.RenderControl(writer);
cell.RenderEndTag(writer);
}
}
示例7: RenderDays
//.........这里部分代码省略.........
for ( ; iDay < 7; iDay++) {
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.RenderEndTag();
}
break;
}
int dayOfWeek = (int)threadCalendar.GetDayOfWeek(d);
int dayOfMonth = threadCalendar.GetDayOfMonth(d);
string dayNumberText;
if ((dayOfMonth <= cachedNumberMax) && usesStandardDayDigits) {
dayNumberText = cachedNumbers[dayOfMonth];
}
else {
dayNumberText = d.ToString("dd", CultureInfo.CurrentCulture);
}
CalendarDay day = new CalendarDay(d,
(dayOfWeek == 0 || dayOfWeek == 6), // IsWeekend
d.Equals(todaysDate), // IsToday
(selectedDates != null) && selectedDates.Contains(d), // IsSelected
threadCalendar.GetMonth(d) != visibleDateMonth, // IsOtherMonth
dayNumberText // Number Text
);
int styleMask = STYLEMASK_DAY;
if (day.IsSelected)
styleMask |= STYLEMASK_SELECTED;
if (day.IsOtherMonth)
styleMask |= STYLEMASK_OTHERMONTH;
if (day.IsToday)
styleMask |= STYLEMASK_TODAY;
if (day.IsWeekend)
styleMask |= STYLEMASK_WEEKEND;
int dayStyleMask = definedStyleMask & styleMask;
// determine the unique portion of the mask for the current calendar,
// which will strip out the day style bit
int dayStyleID = dayStyleMask & STYLEMASK_UNIQUE;
TableItemStyle cellStyle = cellStyles[dayStyleID];
if (cellStyle == null) {
cellStyle = new TableItemStyle();
SetDayStyles(cellStyle, dayStyleMask, defaultWidth);
cellStyles[dayStyleID] = cellStyle;
}
string dayTitle = null;
if (useAccessibleHeader) {
dayTitle = d.ToString("m", CultureInfo.CurrentCulture);
}
if (hasRenderEvent) {
TableCell cdc = new TableCell();
cdc.ApplyStyle(cellStyle);
LiteralControl dayContent = new LiteralControl(dayNumberText);
cdc.Controls.Add(dayContent);
day.IsSelectable = daysSelectable;
OnDayRender(cdc, day);
// refresh the day content
dayContent.Text = GetCalendarButtonText(absoluteDay.ToString(CultureInfo.InvariantCulture),
dayNumberText,
dayTitle,
buttonsActive && day.IsSelectable,
cdc.ForeColor);
cdc.RenderControl(writer);
}
else {
// VSWhidbey 480155: In design mode we render days as
// texts instead of links so CSS class color setting is
// supported. But this differs in runtime rendering
// where CSS class color setting is not supported. To
// correctly mimic the forecolor of runtime rendering in
// design time, the default color, which is used in
// runtime rendering, is explicitly set in this case.
if (inDesignSelectionMode && cellStyle.ForeColor.IsEmpty) {
cellStyle.ForeColor = defaultForeColor;
}
RenderCalendarCell(writer, cellStyle, dayNumberText, dayTitle, daysSelectable, absoluteDay.ToString(CultureInfo.InvariantCulture));
}
Debug.Assert(!passedLastSupportedDate);
if (lastOrSecondLastMonth && d.Month == maxSupportedDate.Month && d.Day == maxSupportedDate.Day) {
passedLastSupportedDate = true;
}
else {
d = threadCalendar.AddDays(d, 1);
absoluteDay++;
}
}
writer.Write(ROWENDTAG);
}
}