本文整理汇总了C#中System.Web.UI.WebControls.Table.CopyBaseAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# Table.CopyBaseAttributes方法的具体用法?C# Table.CopyBaseAttributes怎么用?C# Table.CopyBaseAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Table
的用法示例。
在下文中一共展示了Table.CopyBaseAttributes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected internal override void Render(HtmlTextWriter writer)
{
bool isEnabled;
this.threadCalendar = DateTimeFormatInfo.CurrentInfo.Calendar;
this.minSupportedDate = this.threadCalendar.MinSupportedDateTime;
this.maxSupportedDate = this.threadCalendar.MaxSupportedDateTime;
DateTime visibleDate = this.EffectiveVisibleDate();
DateTime firstDay = this.FirstCalendarDay(visibleDate);
CalendarSelectionMode selectionMode = this.SelectionMode;
if (this.Page != null)
{
this.Page.VerifyRenderingInServerForm(this);
}
if ((this.Page == null) || base.DesignMode)
{
isEnabled = false;
}
else
{
isEnabled = base.IsEnabled;
}
this.defaultForeColor = this.ForeColor;
if (this.defaultForeColor == Color.Empty)
{
this.defaultForeColor = DefaultForeColor;
}
this.defaultButtonColorText = ColorTranslator.ToHtml(this.defaultForeColor);
Table table = new Table();
if (this.ID != null)
{
table.ID = this.ClientID;
}
table.CopyBaseAttributes(this);
if (base.ControlStyleCreated)
{
table.ApplyStyle(base.ControlStyle);
}
table.Width = this.Width;
table.Height = this.Height;
table.CellPadding = this.CellPadding;
table.CellSpacing = this.CellSpacing;
if ((!base.ControlStyleCreated || !base.ControlStyle.IsSet(0x20)) || this.BorderWidth.Equals(Unit.Empty))
{
table.BorderWidth = Unit.Pixel(1);
}
if (this.ShowGridLines)
{
table.GridLines = GridLines.Both;
}
else
{
table.GridLines = GridLines.None;
}
bool useAccessibleHeader = this.UseAccessibleHeader;
if (useAccessibleHeader && (table.Attributes["title"] == null))
{
table.Attributes["title"] = System.Web.SR.GetString("Calendar_TitleText");
}
string caption = this.Caption;
if (caption.Length > 0)
{
table.Caption = caption;
table.CaptionAlign = this.CaptionAlign;
}
table.RenderBeginTag(writer);
if (this.ShowTitle)
{
this.RenderTitle(writer, visibleDate, selectionMode, isEnabled, useAccessibleHeader);
}
if (this.ShowDayHeader)
{
this.RenderDayHeader(writer, visibleDate, selectionMode, isEnabled, useAccessibleHeader);
}
this.RenderDays(writer, firstDay, visibleDate, selectionMode, isEnabled, useAccessibleHeader);
table.RenderEndTag(writer);
}
示例2: RenderContents
protected override void RenderContents (HtmlTextWriter writer)
{
if (Controls.Count == 0)
return;
RepeatInfo repeater = new RepeatInfo ();
Table templateTable = null;
if (extractTemplateRows) {
repeater.RepeatDirection = RepeatDirection.Vertical;
repeater.RepeatLayout = RepeatLayout.Flow;
repeater.RepeatColumns = 1;
repeater.OuterTableImplied = true;
templateTable = new Table ();
templateTable.ID = ClientID;
templateTable.CopyBaseAttributes (this);
templateTable.ApplyStyle (ControlStyle);
templateTable.RenderBeginTag (writer);
} else {
repeater.RepeatDirection = RepeatDirection;
repeater.RepeatLayout = RepeatLayout;
repeater.RepeatColumns = RepeatColumns;
}
repeater.RenderRepeater (writer, this, ControlStyle, this);
if (templateTable != null) {
templateTable.RenderEndTag (writer);
}
}
示例3: RenderContents
/// <internalonly/>
/// <devdoc>
/// </devdoc>
protected internal override void RenderContents(HtmlTextWriter writer) {
if (Controls.Count == 0)
return;
RepeatInfo repeatInfo = new RepeatInfo();
Table outerTable = null;
// NOTE: This will end up creating the ControlStyle... Ideally we would
// not create the style just for rendering, but turns out our default
// style isn't empty, and does have an effect on rendering, and must
// therefore always be created
Style style = ControlStyle;
if (extractTemplateRows) {
// The table tags in the templates are stripped out and only the
// <tr>'s and <td>'s are assumed to come from the template itself.
// This is equivalent to a flow layout of <tr>'s in a single
// vertical column.
repeatInfo.RepeatDirection = RepeatDirection.Vertical;
repeatInfo.RepeatLayout = RepeatLayout.Flow;
repeatInfo.RepeatColumns = 1;
repeatInfo.OuterTableImplied = true;
outerTable = new Table();
// use ClientID (and not ID) since we want to render the fully qualified
// ID even though the control will not be parented to the control hierarchy
outerTable.ID = ClientID;
outerTable.CopyBaseAttributes(this);
outerTable.Caption = Caption;
outerTable.CaptionAlign = CaptionAlign;
outerTable.ApplyStyle(style);
outerTable.RenderBeginTag(writer);
}
else {
repeatInfo.RepeatDirection = RepeatDirection;
repeatInfo.RepeatLayout = RepeatLayout;
repeatInfo.RepeatColumns = RepeatColumns;
if (repeatInfo.RepeatLayout == RepeatLayout.Table) {
repeatInfo.Caption = Caption;
repeatInfo.CaptionAlign = CaptionAlign;
repeatInfo.UseAccessibleHeader = UseAccessibleHeader;
}
else {
repeatInfo.EnableLegacyRendering = EnableLegacyRendering;
}
}
repeatInfo.RenderRepeater(writer, (IRepeatInfoUser)this, style, this);
if (outerTable != null)
outerTable.RenderEndTag(writer);
}
示例4: Render
protected override void Render(HtmlTextWriter writer)
{
globCal = DateTimeFormatInfo.CurrentInfo.Calendar;
DateTime visDate = GetEffectiveVisibleDate();
DateTime firstDate = GetFirstCalendarDay(visDate);
bool isEnabled;
bool isHtmlTextWriter;
//FIXME: when Control.Site works, reactivate this
//if (Page == null || Site == null) {
// isEnabled = false;
// isHtmlTextWriter = false;
//} else {
isEnabled = Enabled;
isHtmlTextWriter = (writer.GetType() != typeof(HtmlTextWriter));
//}
defaultTextColor = ForeColor;
if(defaultTextColor == Color.Empty)
defaultTextColor = Color.Black;
Table calTable = new Table ();
calTable.ID = ID;
calTable.CopyBaseAttributes(this);
if(ControlStyleCreated)
calTable.ApplyStyle(ControlStyle);
calTable.Width = Width;
calTable.Height = Height;
calTable.CellSpacing = CellSpacing;
calTable.CellPadding = CellPadding;
if (ControlStyleCreated &&
ControlStyle.IsSet (WebControls.Style.BORDERWIDTH) &&
BorderWidth != Unit.Empty)
calTable.BorderWidth = BorderWidth;
else
calTable.BorderWidth = Unit.Pixel(1);
if (ShowGridLines)
calTable.GridLines = GridLines.Both;
else
calTable.GridLines = GridLines.None;
#if NET_2_0
calTable.Caption = Caption;
calTable.CaptionAlign = CaptionAlign;
#endif
calTable.RenderBeginTag (writer);
if (ShowTitle)
RenderTitle (writer, visDate, SelectionMode, isEnabled);
if (ShowDayHeader)
RenderHeader (writer, firstDate, SelectionMode, isEnabled, isHtmlTextWriter);
RenderAllDays (writer, firstDate, visDate, SelectionMode, isEnabled, isHtmlTextWriter);
calTable.RenderEndTag(writer);
}
示例5: CreateTable
/*********************************************************************************
*
* Calendar rendering methods
*
*********************************************************************************/
//Creates the table for the calendar
private Table CreateTable(DateTime visibleDate, DateTime firstDay, System.Globalization.Calendar threadCalendar)
{
Color defaultColor = ForeColor;
if (defaultColor == Color.Empty)
{
defaultColor = Color.Black;
}
defaultButtonColorText = ColorTranslator.ToHtml(defaultColor);
Table table = new Table();
if (ID != null)
{
table.ID = ClientID;
}
table.CopyBaseAttributes(this);
if (ControlStyleCreated)
{
table.ApplyStyle(ControlStyle);
}
table.Width = Width;
table.Height = Height;
table.CellPadding = CellPadding;
table.CellSpacing = CellSpacing;
// default look
if ((ControlStyleCreated == false) ||
BorderWidth.Equals(Unit.Empty))
{
table.BorderWidth = Unit.Pixel(1);
}
if (ShowGridLines)
{
table.GridLines = GridLines.Both;
}
else
{
table.GridLines = GridLines.None;
}
bool useAccessibleHeader = UseAccessibleHeader;
if (useAccessibleHeader)
{
if (table.Attributes["title"] == null)
{
table.Attributes["title"] = string.Empty;
}
}
string caption = Caption;
if (caption.Length > 0)
{
table.Caption = caption;
table.CaptionAlign = CaptionAlign;
}
if (ShowTitle)
{
table.Rows.Add(CreateTitleRow(visibleDate, threadCalendar));
}
if (ShowDayHeader)
{
table.Rows.Add(CreateDayHeader(firstDay, visibleDate, threadCalendar));
}
return table;
}
示例6: Render
/// <internalonly/>
/// <devdoc>
/// <para>Displays the <see cref='System.Web.UI.WebControls.Calendar'/> control on the client.</para>
/// </devdoc>
protected internal override void Render(HtmlTextWriter writer) {
threadCalendar = DateTimeFormatInfo.CurrentInfo.Calendar;
minSupportedDate = threadCalendar.MinSupportedDateTime;
maxSupportedDate = threadCalendar.MaxSupportedDateTime;
#if DEBUG
threadCalendarInitialized = true;
#endif
DateTime visibleDate = EffectiveVisibleDate();
DateTime firstDay = FirstCalendarDay(visibleDate);
CalendarSelectionMode selectionMode = SelectionMode;
// Make sure we are in a form tag with runat=server.
if (Page != null) {
Page.VerifyRenderingInServerForm(this);
}
// We only want to display the link if we have a page, or if we are on the design surface
// If we can stops links being active on the Autoformat dialog, then we can remove this these checks.
Page page = Page;
bool buttonsActive;
if (page == null || DesignMode) {
buttonsActive = false;
}
else {
buttonsActive = IsEnabled;
}
defaultForeColor = ForeColor;
if (defaultForeColor == Color.Empty) {
defaultForeColor = DefaultForeColor;
}
defaultButtonColorText = ColorTranslator.ToHtml(defaultForeColor);
Table table = new Table();
if (ID != null) {
table.ID = ClientID;
}
table.CopyBaseAttributes(this);
if (ControlStyleCreated) {
table.ApplyStyle(ControlStyle);
}
table.Width = Width;
table.Height = Height;
table.CellPadding = CellPadding;
table.CellSpacing = CellSpacing;
// default look
if ((ControlStyleCreated == false) ||
(ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_BORDERWIDTH) == false) ||
BorderWidth.Equals(Unit.Empty)) {
table.BorderWidth = Unit.Pixel(1);
}
if (ShowGridLines) {
table.GridLines = GridLines.Both;
}
else {
table.GridLines = GridLines.None;
}
bool useAccessibleHeader = UseAccessibleHeader;
if (useAccessibleHeader) {
if (table.Attributes["title"] == null) {
table.Attributes["title"] = SR.GetString(SR.Calendar_TitleText);
}
}
string caption = Caption;
if (caption.Length > 0) {
table.Caption = caption;
table.CaptionAlign = CaptionAlign;
}
table.RenderBeginTag(writer);
if (ShowTitle) {
RenderTitle(writer, visibleDate, selectionMode, buttonsActive, useAccessibleHeader);
}
if (ShowDayHeader) {
RenderDayHeader(writer, visibleDate, selectionMode, buttonsActive, useAccessibleHeader);
}
RenderDays(writer, firstDay, visibleDate, selectionMode, buttonsActive, useAccessibleHeader);
table.RenderEndTag(writer);
}
示例7: RenderContents
protected internal override void RenderContents(HtmlTextWriter writer)
{
if (this.Controls.Count != 0)
{
RepeatInfo info = new RepeatInfo();
Table table = null;
Style controlStyle = base.ControlStyle;
if (this.extractTemplateRows)
{
info.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Vertical;
info.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
info.RepeatColumns = 1;
info.OuterTableImplied = true;
table = new Table {
ID = this.ClientID
};
table.CopyBaseAttributes(this);
table.Caption = this.Caption;
table.CaptionAlign = this.CaptionAlign;
table.ApplyStyle(controlStyle);
table.RenderBeginTag(writer);
}
else
{
info.RepeatDirection = this.RepeatDirection;
info.RepeatLayout = this.RepeatLayout;
info.RepeatColumns = this.RepeatColumns;
if (info.RepeatLayout == System.Web.UI.WebControls.RepeatLayout.Table)
{
info.Caption = this.Caption;
info.CaptionAlign = this.CaptionAlign;
info.UseAccessibleHeader = this.UseAccessibleHeader;
}
else
{
info.EnableLegacyRendering = base.EnableLegacyRendering;
}
}
info.RenderRepeater(writer, this, controlStyle, this);
if (table != null)
{
table.RenderEndTag(writer);
}
}
}