📄 tableitemstyle.cs
字号:
using System;
using System.ComponentModel;
namespace System.Web.UI.WebControls
{
/// <summary>
/// Summary description for TableItemStyle.
/// </summary>
public class TableItemStyle : Style
{
private int PROP_HORZALIGN = 65536;
private int PROP_VERTALIGN = 131072;
private int PROP_WRAP = 262144;
public TableItemStyle() : base()
{
}
public TableItemStyle(StateBag bag) : base(bag)
{
}
public virtual void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
{
HorizontalAlign local0;
TypeConverter local1;
VerticalAlign local2;
TypeConverter local3;
this.AddAttributesToRender(writer, owner);
if (!(this.Wrap))
writer.AddAttribute(HtmlTextWriterAttribute.Nowrap, "nowrap");
local0 = this.HorizontalAlign;
if (local0 != 0)
{
local1 = System.ComponentModel.TypeDescriptor.GetConverter(typeof(HorizontalAlign));
writer.AddAttribute(HtmlTextWriterAttribute.Align, local1.ConvertToString(local0));
}
local2 = this.VerticalAlign;
if (local2 != 0)
{
local3 = System.ComponentModel.TypeDescriptor.GetConverter(typeof(VerticalAlign));
writer.AddAttribute(HtmlTextWriterAttribute.Valign, local3.ConvertToString(local2));
}
}
public virtual void CopyFrom(Style s)
{
TableItemStyle local0;
if (s != null && !(s.IsEmpty))
{
this.CopyFrom(s);
if (s as TableItemStyle != null)
{
local0 = (TableItemStyle) s;
if (local0.IsSet(65536))
this.HorizontalAlign = local0.HorizontalAlign;
if (local0.IsSet(131072))
this.VerticalAlign = local0.VerticalAlign;
if (local0.IsSet(262144))
this.Wrap = local0.Wrap;
}
}
}
public virtual void MergeWith(Style s)
{
TableItemStyle local0;
if (s != null && !(s.IsEmpty))
{
if (this.IsEmpty)
{
this.CopyFrom(s);
return;
}
this.MergeWith(s);
if (s as TableItemStyle != null)
{
local0 = (TableItemStyle) s;
if (local0.IsSet(65536) && !(this.IsSet(65536)))
this.HorizontalAlign = local0.HorizontalAlign;
if (local0.IsSet(131072) && !(this.IsSet(131072)))
this.VerticalAlign = local0.VerticalAlign;
if (local0.IsSet(262144) && !(this.IsSet(262144)))
this.Wrap = local0.Wrap;
}
}
}
public virtual void Reset()
{
if (this.IsSet(65536))
this.ViewState.Remove("HorizontalAlign");
if (this.IsSet(131072))
this.ViewState.Remove("VerticalAlign");
if (this.IsSet(262144))
this.ViewState.Remove("Wrap");
this.Reset();
}
public virtual HorizontalAlign HorizontalAlign
{
get
{
if (this.IsSet(65536))
return (HorizontalAlign) this.ViewState["HorizontalAlign"];
return (HorizontalAlign)0;
}
set
{
if (value < (HorizontalAlign)0 || value > (HorizontalAlign)4)
throw new ArgumentOutOfRangeException("value");
this.ViewState["HorizontalAlign"]= value;
this.SetBit(65536);
}
}
public virtual VerticalAlign VerticalAlign
{
get
{
if (this.IsSet(131072))
return (VerticalAlign) this.ViewState["VerticalAlign"];
return (VerticalAlign)0;
}
set
{
if (value < (VerticalAlign)0 || value > (VerticalAlign)3)
throw new ArgumentOutOfRangeException("value");
this.ViewState["VerticalAlign"]= value;
this.SetBit(131072);
}
}
public virtual bool Wrap
{
get
{
if (this.IsSet(262144))
return (Boolean) this.ViewState["Wrap"];
return true;
}
set
{
this.ViewState["Wrap"]= value;
this.SetBit(262144);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -