Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -35,17 +35,11 @@ namespace System.Web.UI.WebControls {
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[ParseChildren (true)]
#if NET_2_0
[PersistChildrenAttribute (false, false)]
[Themeable (true)]
#else
[PersistChildrenAttribute (false)]
#endif
public class WebControl : Control, IAttributeAccessor
{
#if NET_4_0
const string DEFAULT_DISABLED_CSS_CLASS = "aspNetDisabled";
#endif
Style style;
HtmlTextWriterTag tag;
string tag_name;
@ -53,12 +47,10 @@ namespace System.Web.UI.WebControls {
StateBag attribute_state;
bool enabled;
bool track_enabled_state;
#if NET_4_0
static WebControl ()
{
DisabledCssClass = DEFAULT_DISABLED_CSS_CLASS;
}
#endif
public WebControl (HtmlTextWriterTag tag)
{
this.tag = tag;
@ -76,9 +68,6 @@ namespace System.Web.UI.WebControls {
this.enabled = true;
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue("")]
[WebSysDescription ("")]
[WebCategory ("Behavior")]
@ -111,9 +100,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
[WebSysDescription ("")]
@ -130,9 +116,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
[WebSysDescription ("")]
@ -150,9 +133,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(BorderStyle.NotSet)]
[WebSysDescription ("")]
[WebCategory ("Appearance")]
@ -171,9 +151,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Unit), "")]
[WebSysDescription ("")]
[WebCategory ("Appearance")]
@ -206,9 +183,7 @@ namespace System.Web.UI.WebControls {
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Never)]
#endif
public bool ControlStyleCreated {
get {
return style != null;
@ -233,9 +208,7 @@ namespace System.Web.UI.WebControls {
[Bindable(true)]
[DefaultValue(true)]
#if NET_2_0
[Themeable (false)]
#endif
public virtual bool Enabled {
get {
return enabled;
@ -250,18 +223,13 @@ namespace System.Web.UI.WebControls {
}
}
#if NET_2_0
[Browsable (true)]
public virtual new bool EnableTheming
{
get { return base.EnableTheming; }
set { base.EnableTheming = value; }
}
#endif
#if ONLY_1_1
[DefaultValue(null)]
#endif
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[NotifyParentProperty(true)]
[WebSysDescription ("")]
@ -274,9 +242,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
[WebSysDescription ("")]
@ -295,11 +260,7 @@ namespace System.Web.UI.WebControls {
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
#if NET_2_0
public
#else
internal
#endif
bool HasAttributes
{
get {
@ -307,9 +268,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Unit), "")]
[WebSysDescription ("")]
[WebCategory ("Layout")]
@ -325,14 +283,12 @@ namespace System.Web.UI.WebControls {
}
}
#if NET_2_0
[Browsable (true)]
public virtual new string SkinID
{
get { return base.SkinID; }
set { base.SkinID = value; }
}
#endif
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@ -356,13 +312,8 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue("")]
#if NET_2_0
[Localizable (true)]
#endif
[WebSysDescription ("")]
[WebCategory ("Behavior")]
public virtual string ToolTip {
@ -374,9 +325,6 @@ namespace System.Web.UI.WebControls {
}
}
#if ONLY_1_1
[Bindable(true)]
#endif
[DefaultValue(typeof (Unit), "")]
[WebSysDescription ("")]
[WebCategory ("Layout")]
@ -412,13 +360,10 @@ namespace System.Web.UI.WebControls {
}
}
#if NET_2_0
protected
#endif
internal bool IsEnabled
{
get {
#if NET_2_0
WebControl wc = this;
while (wc != null) {
if (!wc.Enabled)
@ -426,12 +371,8 @@ namespace System.Web.UI.WebControls {
wc = wc.Parent as WebControl;
}
return true;
#else
return Enabled;
#endif
}
}
#if NET_4_0
public static string DisabledCssClass {
get;
set;
@ -441,7 +382,6 @@ namespace System.Web.UI.WebControls {
public virtual bool SupportsDisabledAttribute {
get { return true; }
}
#endif
public void ApplyStyle (Style s)
{
if (s != null && !s.IsEmpty)
@ -516,7 +456,6 @@ namespace System.Web.UI.WebControls {
return attr;
}
#if NET_2_0
internal void AddDisplayStyleAttribute (HtmlTextWriter writer)
{
if (!ControlStyleCreated)
@ -528,15 +467,12 @@ namespace System.Web.UI.WebControls {
!ControlStyle.Width.IsEmpty)
writer.AddStyleAttribute (HtmlTextWriterStyle.Display, "inline-block");
}
#endif
void RenderDisabled (HtmlTextWriter writer)
{
if (!IsEnabled) {
#if NET_4_0
if (!SupportsDisabledAttribute)
ControlStyle.PrependCssClass (DisabledCssClass);
else
#endif
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
}
@ -544,14 +480,9 @@ namespace System.Web.UI.WebControls {
protected virtual void AddAttributesToRender (HtmlTextWriter writer)
{
#if NET_4_0
RenderDisabled (writer);
#endif
if (ID != null)
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
#if !NET_4_0
RenderDisabled (writer);
#endif
if (AccessKey != string.Empty)
writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
@ -562,11 +493,9 @@ namespace System.Web.UI.WebControls {
writer.AddAttribute (HtmlTextWriterAttribute.Tabindex, TabIndex.ToString ());
if (style != null && !style.IsEmpty) {
#if NET_2_0
//unbelievable, but see WebControlTest.RenderBeginTag_BorderWidth_xxx
if (TagKey == HtmlTextWriterTag.Span)
AddDisplayStyleAttribute (writer);
#endif
style.AddAttributesToRender(writer, this);
}
@ -606,7 +535,6 @@ namespace System.Web.UI.WebControls {
enabled = ViewState.GetBool ("Enabled", enabled);
}
#if NET_4_0
internal virtual string InlinePropertiesSet ()
{
var properties = new List <string> ();
@ -659,30 +587,19 @@ namespace System.Web.UI.WebControls {
);
}
}
#endif
#if NET_2_0
protected internal
#else
protected
#endif
override void Render (HtmlTextWriter writer)
{
#if NET_2_0
if (Adapter != null) {
Adapter.Render(writer);
return;
}
#endif
RenderBeginTag (writer);
RenderContents (writer);
RenderEndTag (writer);
}
#if NET_2_0
protected internal
#else
protected
#endif
virtual void RenderContents (HtmlTextWriter writer)
{
base.Render (writer);