/// <include file='doc\TableStyle.uex' path='docs/doc[@for="TableStyle.CopyFrom"]/*' /> /// <internalonly/> /// <devdoc> /// <para>Copies non-blank elements from the specified style, overwriting existing /// style elements if necessary.</para> /// </devdoc> public override void CopyFrom(Style s) { if (s != null && !s.IsEmpty) { base.CopyFrom(s); if (s is TableStyle) { TableStyle ts = (TableStyle)s; if (ts.IsSet(PROP_BACKIMAGEURL)) { this.BackImageUrl = ts.BackImageUrl; } if (ts.IsSet(PROP_CELLPADDING)) { this.CellPadding = ts.CellPadding; } if (ts.IsSet(PROP_CELLSPACING)) { this.CellSpacing = ts.CellSpacing; } if (ts.IsSet(PROP_GRIDLINES)) { this.GridLines = ts.GridLines; } if (ts.IsSet(PROP_HORZALIGN)) { this.HorizontalAlign = ts.HorizontalAlign; } } } }
/// <internalonly/> /// <devdoc> /// <para>Copies non-blank elements from the specified style, but will not overwrite /// any existing style elements.</para> /// </devdoc> public override void MergeWith(Style s) { if (s != null && !s.IsEmpty) { if (IsEmpty) { // merge into an empty style is equivalent to a copy, // which is more efficient CopyFrom(s); return; } base.MergeWith(s); TableStyle ts = s as TableStyle; if (ts != null) { // Since we're already copying the registered CSS class in base.MergeWith, we don't // need to any attributes that would be included in that class. if (s.RegisteredCssClass.Length == 0) { if (ts.IsSet(PROP_BACKIMAGEURL) && !this.IsSet(PROP_BACKIMAGEURL)) { this.BackImageUrl = ts.BackImageUrl; } } if (ts.IsSet(PROP_CELLPADDING) && !this.IsSet(PROP_CELLPADDING)) { this.CellPadding = ts.CellPadding; } if (ts.IsSet(PROP_CELLSPACING) && !this.IsSet(PROP_CELLSPACING)) { this.CellSpacing = ts.CellSpacing; } if (ts.IsSet(PROP_GRIDLINES) && !this.IsSet(PROP_GRIDLINES)) { this.GridLines = ts.GridLines; } if (ts.IsSet(PROP_HORZALIGN) && !this.IsSet(PROP_HORZALIGN)) { this.HorizontalAlign = ts.HorizontalAlign; } } } }
/// <include file='doc\TableStyle.uex' path='docs/doc[@for="TableStyle.MergeWith"]/*' /> /// <internalonly/> /// <devdoc> /// <para>Copies non-blank elements from the specified style, but will not overwrite /// any existing style elements.</para> /// </devdoc> public override void MergeWith(Style s) { if (s != null && !s.IsEmpty) { if (IsEmpty) { // merge into an empty style is equivalent to a copy, // which is more efficient CopyFrom(s); return; } base.MergeWith(s); if (s is TableStyle) { TableStyle ts = (TableStyle)s; if (ts.IsSet(PROP_BACKIMAGEURL) && !this.IsSet(PROP_BACKIMAGEURL)) { this.BackImageUrl = ts.BackImageUrl; } if (ts.IsSet(PROP_CELLPADDING) && !this.IsSet(PROP_CELLPADDING)) { this.CellPadding = ts.CellPadding; } if (ts.IsSet(PROP_CELLSPACING) && !this.IsSet(PROP_CELLSPACING)) { this.CellSpacing = ts.CellSpacing; } if (ts.IsSet(PROP_GRIDLINES) && !this.IsSet(PROP_GRIDLINES)) { this.GridLines = ts.GridLines; } if (ts.IsSet(PROP_HORZALIGN) && !this.IsSet(PROP_HORZALIGN)) { this.HorizontalAlign = ts.HorizontalAlign; } } } }
public override void MergeWith(Style s) { if ((s != null) && !s.IsEmpty) { if (this.IsEmpty) { this.CopyFrom(s); } else { base.MergeWith(s); TableStyle style = s as TableStyle; if (style != null) { if (((s.RegisteredCssClass.Length == 0) && style.IsSet(0x10000)) && !base.IsSet(0x10000)) { this.BackImageUrl = style.BackImageUrl; } if (style.IsSet(0x20000) && !base.IsSet(0x20000)) { this.CellPadding = style.CellPadding; } if (style.IsSet(0x40000) && !base.IsSet(0x40000)) { this.CellSpacing = style.CellSpacing; } if (style.IsSet(0x80000) && !base.IsSet(0x80000)) { this.GridLines = style.GridLines; } if (style.IsSet(0x100000) && !base.IsSet(0x100000)) { this.HorizontalAlign = style.HorizontalAlign; } } } } }
/// <internalonly/> /// <devdoc> /// <para>Copies non-blank elements from the specified style, overwriting existing /// style elements if necessary.</para> /// </devdoc> public override void CopyFrom(Style s) { if (s != null && !s.IsEmpty) { base.CopyFrom(s); TableStyle ts = s as TableStyle; if (ts != null) { // Only copy the BackImageUrl if it isn't in the source Style's registered CSS class if (s.RegisteredCssClass.Length != 0) { if (ts.IsSet(PROP_BACKIMAGEURL)) { ViewState.Remove("BackImageUrl"); ClearBit(PROP_BACKIMAGEURL); } } else { if (ts.IsSet(PROP_BACKIMAGEURL)) { this.BackImageUrl = ts.BackImageUrl; } } if (ts.IsSet(PROP_CELLPADDING)) { this.CellPadding = ts.CellPadding; } if (ts.IsSet(PROP_CELLSPACING)) { this.CellSpacing = ts.CellSpacing; } if (ts.IsSet(PROP_GRIDLINES)) { this.GridLines = ts.GridLines; } if (ts.IsSet(PROP_HORZALIGN)) { this.HorizontalAlign = ts.HorizontalAlign; } } } }
public override void CopyFrom(Style s) { if ((s != null) && !s.IsEmpty) { base.CopyFrom(s); TableStyle style = s as TableStyle; if (style != null) { if (s.RegisteredCssClass.Length != 0) { if (style.IsSet(0x10000)) { base.ViewState.Remove("BackImageUrl"); base.ClearBit(0x10000); } } else if (style.IsSet(0x10000)) { this.BackImageUrl = style.BackImageUrl; } if (style.IsSet(0x20000)) { this.CellPadding = style.CellPadding; } if (style.IsSet(0x40000)) { this.CellSpacing = style.CellSpacing; } if (style.IsSet(0x80000)) { this.GridLines = style.GridLines; } if (style.IsSet(0x100000)) { this.HorizontalAlign = style.HorizontalAlign; } } } }