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

@@ -126,11 +126,9 @@ namespace System.Web.UI.WebControls
requiresDataBinding = value;
}
}
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
protected void ConfirmInitState ()
{
initialized = true;

View File

@@ -262,11 +262,9 @@ namespace System.Web.UI.WebControls
return selectArguments;
}
}
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
TableStyle TableStyle {
// this will throw an InvalidCasException just like we need
get { return (TableStyle) ControlStyle; }

View File

@@ -345,11 +345,7 @@ namespace System.Web.UI.WebControls
writer.AddStyleAttribute ("cursor", "text");
} else if (item.NavigateUrl != String.Empty) {
string target = item.Target != String.Empty ? item.Target : owner.Target;
#if TARGET_J2EE
string navUrl = owner.ResolveClientUrl (item.NavigateUrl, String.Compare (target, "_blank", StringComparison.InvariantCultureIgnoreCase) != 0);
#else
string navUrl = owner.ResolveClientUrl (item.NavigateUrl);
#endif
writer.AddAttribute ("href", navUrl);
if (target != String.Empty)
writer.AddAttribute ("target", target);

View File

@@ -250,27 +250,8 @@ namespace System.Web.UI.WebControls
{
if (!EnableClientScript)
return false;
#if TARGET_J2EE
if (HttpContext.Current == null)
return false;
return (
/* From someplace on the web: "JavaScript 1.2
* and later (also known as ECMAScript) has
* built-in support for regular
* expressions" */
((Page.Request.Browser.EcmaScriptVersion.Major == 1
&& Page.Request.Browser.EcmaScriptVersion.Minor >= 2)
|| (Page.Request.Browser.EcmaScriptVersion.Major > 1))
/* document.getElementById, .getAttribute,
* etc, are all DOM level 1. I don't think we
* use anything in level 2.. */
&& Page.Request.Browser.W3CDomVersion.Major >= 1);
#else
return UplevelHelper.IsUplevel (
System.Web.Configuration.HttpCapabilitiesBase.GetUserAgentForDetection (HttpContext.Current.Request));
#endif
}
protected abstract bool EvaluateIsValid ();

View File

@@ -147,11 +147,7 @@ namespace System.Web.UI.WebControls
{
PostBackOptions options = new PostBackOptions (this);
options.ActionUrl = (PostBackUrl.Length > 0 ?
#if TARGET_J2EE
CreateActionUrl(PostBackUrl)
#else
Page.ResolveClientUrl (PostBackUrl)
#endif
: null);
options.ValidationGroup = null;
options.Argument = String.Empty;

View File

@@ -492,11 +492,9 @@ namespace System.Web.UI.WebControls
return weekendDayStyle;
}
}
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
// Private properties
DateTimeFormatInfo DateInfo {
get {

View File

@@ -43,9 +43,7 @@ namespace System.Web.UI.WebControls
[DefaultEvent ("ChangedPassword")]
[Designer ("System.Web.UI.Design.WebControls.ChangePasswordDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public class ChangePassword : CompositeControl, INamingContainer
#if NET_4_0
, IRenderOuterTable
#endif
{
static readonly object cancelButtonClickEvent = new object ();
static readonly object changedPasswordEvent = new object ();
@@ -58,9 +56,7 @@ namespace System.Web.UI.WebControls
public static readonly string CancelButtonCommandName = "Cancel";
public static readonly string ChangePasswordButtonCommandName = "ChangePassword";
public static readonly string ContinueButtonCommandName = "Continue";
#if NET_4_0
bool renderOuterTable = true;
#endif
Style _cancelButtonStyle = null;
Style _changePasswordButtonStyle = null;
Style _continueButtonStyle = null;
@@ -589,14 +585,12 @@ namespace System.Web.UI.WebControls
get { return ViewState.GetString ("PasswordRequiredErrorMessage", String.Empty); }
set { ViewState ["PasswordRequiredErrorMessage"] = value; }
}
#if NET_4_0
// LAMESPEC: MSDN claims it's present in 3.5, but it's not
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
set { renderOuterTable = value; }
}
#endif
[DefaultValue ("")]
[UrlProperty]
[Editor ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
@@ -765,9 +759,7 @@ namespace System.Web.UI.WebControls
protected internal override void Render (HtmlTextWriter writer)
{
#if NET_4_0
VerifyInlinePropertiesNotSet ();
#endif
for (int i = 0; i < Controls.Count; i++)
if (Controls [i].Visible)
Controls [i].Render (writer);
@@ -1144,9 +1136,7 @@ namespace System.Web.UI.WebControls
class BaseChangePasswordContainer : Control, INamingContainer, INonBindingContainer
{
protected readonly ChangePassword _owner = null;
#if NET_4_0
bool renderOuterTable;
#endif
Table _table = null;
TableCell _containerCell = null;
@@ -1156,31 +1146,25 @@ namespace System.Web.UI.WebControls
throw new ArgumentNullException ("owner");
_owner = owner;
#if NET_4_0
renderOuterTable = _owner.RenderOuterTable;
if (renderOuterTable)
#endif
InitTable ();
}
public void InstantiateTemplate (ITemplate template)
{
#if NET_4_0
if (!_owner.RenderOuterTable)
template.InstantiateIn (this);
else
#endif
template.InstantiateIn (_containerCell);
}
void InitTable ()
{
_table = new Table ();
#if NET_4_0
string id = _owner.ID;
if (!String.IsNullOrEmpty (id))
#endif
_table.Attributes.Add ("id", _owner.ID);
_table.CellSpacing = 0;
@@ -1327,7 +1311,6 @@ namespace System.Web.UI.WebControls
{
Table table = new Table ();
table.CellPadding = 0;
#if NET_4_0
Style ownerStyle = _owner.ControlStyle;
Style tableStyle = table.ControlStyle;
FontInfo ownerFont = ownerStyle.Font;
@@ -1340,7 +1323,6 @@ namespace System.Web.UI.WebControls
tableStyle.ForeColor = ownerForeColor;
ownerStyle.RemoveBit ((int)global::System.Web.UI.WebControls.Style.Styles.ForeColor);
}
#endif
// Row #0
table.Controls.Add (
CreateRow (new LiteralControl (_owner.ChangePasswordTitleText),

View File

@@ -315,11 +315,9 @@ namespace System.Web.UI.WebControls
bool need_span = ControlStyleCreated && !ControlStyle.IsEmpty;
bool enabled = IsEnabled;
if (!enabled) {
#if NET_4_0
if (!RenderingCompatibilityLessThan40)
ControlStyle.PrependCssClass (DisabledCssClass);
else
#endif
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
need_span = true;
}

View File

@@ -95,11 +95,7 @@ namespace System.Web.UI.WebControls
get { return (RepeatLayout) ViewState.GetInt ("RepeatLayout", (int) RepeatLayout.Table); }
set {
bool outOfRange;
#if NET_4_0
outOfRange = value < RepeatLayout.Table || value > RepeatLayout.OrderedList;
#else
outOfRange = value < RepeatLayout.Table || value > RepeatLayout.Flow;
#endif
if (outOfRange)
throw new ArgumentOutOfRangeException ("value");
ViewState ["RepeatLayout"] = value;
@@ -298,14 +294,12 @@ namespace System.Web.UI.WebControls
check_box.Attributes.Clear ();
if (item.HasAttributes)
check_box.Attributes.CopyFrom (item.Attributes);
#if NET_4_0
if (!RenderingCompatibilityLessThan40) {
var attrs = check_box.InputAttributes;
attrs.Clear ();
attrs.Add ("value", item.Value);
}
#endif
check_box.RenderControl (writer);
}

View File

@@ -38,11 +38,9 @@ namespace System.Web.UI.WebControls
[Designer ("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor
{
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
protected CompositeControl ()
{
}

View File

@@ -36,7 +36,6 @@ namespace System.Web.UI.WebControls
{
internal class ContentPlaceHolderBuilder: ControlBuilder
{
#if !TARGET_J2EE
public override void Init (TemplateParser parser, ControlBuilder parentBuilder, Type type,
string tagName, string ID, IDictionary attribs)
{
@@ -58,7 +57,6 @@ namespace System.Web.UI.WebControls
mpp.AddContentPlaceHolderId (id);
}
#endif
}
}

View File

@@ -77,11 +77,7 @@ namespace System.Web.UI.WebControls
{
return new ControlParameter (this);
}
#if NET_4_0
protected internal
#else
protected
#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (control == null)

View File

@@ -67,11 +67,7 @@ namespace System.Web.UI.WebControls
{
return new CookieParameter (this);
}
#if NET_4_0
protected internal
#else
protected
#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (ctx == null || ctx.Request == null)

View File

@@ -34,9 +34,7 @@ using System.Collections.Specialized;
namespace System.Web.UI.WebControls
{
public class DataKey : IStateManager
#if NET_4_0
, IEquatable <DataKey>
#endif
{
IOrderedDictionary keyTable;
string[] keyNames;
@@ -81,7 +79,6 @@ namespace System.Web.UI.WebControls
return readonlyKeyTable;
}
}
#if NET_4_0
public bool Equals (DataKey other)
{
if (other == null)
@@ -123,7 +120,6 @@ namespace System.Web.UI.WebControls
return true;
}
#endif
protected virtual void LoadViewState (object savedState)
{
if (savedState is Pair) {

View File

@@ -307,10 +307,8 @@ namespace System.Web.UI.WebControls
return (o == null) ? RepeatLayout.Table : (RepeatLayout) o;
}
set {
#if NET_4_0
if (value == RepeatLayout.OrderedList || value == RepeatLayout.UnorderedList)
throw new ArgumentOutOfRangeException (String.Format ("DataList does not support the '{0}' layout.", value));
#endif
ViewState ["RepeatLayout"] = value;
}
}

View File

@@ -61,11 +61,9 @@ namespace System.Web.UI.WebControls
public virtual ListItemType ItemType {
get { return type; }
}
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
protected override Style CreateControlStyle ()
{
return new TableItemStyle (ViewState);

View File

@@ -43,15 +43,11 @@ namespace System.Web.UI.WebControls
[DesignerAttribute ("System.Web.UI.Design.WebControls.DetailsViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[ControlValuePropertyAttribute ("SelectedValue")]
[DefaultEventAttribute ("PageIndexChanging")]
#if NET_4_0
[DataKeyProperty ("DataKey")]
#endif
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
#if NET_4_0
, IDataBoundItemControl, IDataBoundControl, IFieldControl
#endif
{
object dataItem;
@@ -300,7 +296,6 @@ namespace System.Web.UI.WebControls
throw new HttpException (String.Format (unhandledEventExceptionMessage, ID, "ItemUpdating"));
}
#if NET_4_0
DataBoundControlMode IDataBoundItemControl.Mode {
get {
switch (CurrentMode) {
@@ -332,7 +327,6 @@ namespace System.Web.UI.WebControls
throw new NotImplementedException ();
}
}
#endif
[WebCategoryAttribute ("Paging")]
[DefaultValueAttribute (false)]
public virtual bool AllowPaging {
@@ -1600,9 +1594,7 @@ namespace System.Web.UI.WebControls
break;
}
}
#if NET_4_0
public
#endif
void SetPageIndex (int newIndex)
{
DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);

View File

@@ -81,11 +81,9 @@ namespace System.Web.UI.WebControls
set { base.SelectedIndex = value; }
}
#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
#endif
#endregion // Public Instance Properties
#region Protected Instance Methods

View File

@@ -67,11 +67,7 @@ namespace System.Web.UI.WebControls
{
return new FormParameter (this);
}
#if NET_4_0
protected internal
#else
protected
#endif
override object Evaluate (HttpContext ctx, Control control)
{
HttpRequest req = ctx != null ? ctx.Request : null;

View File

@@ -42,15 +42,11 @@ namespace System.Web.UI.WebControls
[DesignerAttribute ("System.Web.UI.Design.WebControls.FormViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[ControlValuePropertyAttribute ("SelectedValue")]
[DefaultEventAttribute ("PageIndexChanging")]
#if NET_4_0
[DataKeyProperty ("DataKey")]
#endif
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class FormView: CompositeDataBoundControl, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
#if NET_4_0
, IDataBoundItemControl, IDataBoundControl, IRenderOuterTable
#endif
{
object dataItem;
@@ -91,9 +87,7 @@ namespace System.Web.UI.WebControls
IOrderedDictionary _keyTable;
DataKey key;
DataKey oldEditValues;
#if NET_4_0
bool renderOuterTable = true;
#endif
static readonly object PageIndexChangedEvent = new object();
static readonly object PageIndexChangingEvent = new object();
static readonly object ItemCommandEvent = new object();
@@ -809,7 +803,6 @@ namespace System.Web.UI.WebControls
get;
set;
}
#if NET_4_0
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
@@ -869,7 +862,6 @@ namespace System.Web.UI.WebControls
return baseProps + ", " + props;
}
#endif
public virtual bool IsBindableType (Type type)
{
return type.IsPrimitive || type == typeof (string) || type == typeof (DateTime) || type == typeof (Guid) || type == typeof (Decimal);
@@ -1111,9 +1103,7 @@ namespace System.Web.UI.WebControls
}
cell.ColumnSpan = 2;
row.Cells.Add (cell);
#if NET_4_0
row.RenderJustCellContents = !RenderOuterTable;
#endif
}
void FillRowDataKey (object dataItem)
@@ -1344,9 +1334,7 @@ namespace System.Web.UI.WebControls
break;
}
}
#if NET_4_0
public
#endif
void SetPageIndex (int index)
{
FormViewPageEventArgs args = new FormViewPageEventArgs (index);
@@ -1613,17 +1601,13 @@ namespace System.Web.UI.WebControls
protected internal override void Render (HtmlTextWriter writer)
{
#if NET_4_0
VerifyInlinePropertiesNotSet ();
if (RenderOuterTable) {
#endif
PrepareControlHierarchy ();
if (table != null)
table.Render (writer);
#if NET_4_0
} else if (table != null)
table.RenderChildren (writer);
#endif
}
PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)

Some files were not shown because too many files have changed in this diff Show More