Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,118 @@
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Tests
{
public class CustomCheckBoxColumn : CheckBoxField
{
string caseId;
public CustomCheckBoxColumn (string id)
{
this.caseId = id;
}
protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowState rowState)
{
switch (caseId) {
default:
case "0":
Case0 (cell);
break;
case "1":
Case1 (cell);
break;
case "2":
Case2 (cell);
break;
case "3":
Case3 (cell);
break;
case "4":
Case4 (cell);
break;
case "5":
Case5 (cell);
break;
case "6":
Case6 (cell);
break;
case "7":
Case7 (cell);
break;
}
}
void Case0 (DataControlFieldCell cell)
{
CheckBox checkBox = new CheckBox();
checkBox.ToolTip = "Dummy";
cell.Controls.Add(checkBox);
checkBox.DataBinding += OnDataBindField;
}
void Case1 (DataControlFieldCell cell)
{
ListBox lb = new ListBox ();
cell.Controls.Add(lb);
Case0 (cell);
}
void Case2 (DataControlFieldCell cell)
{
cell.Controls.Add(new CheckBox ());
Case0 (cell);
cell.Controls.Add(new CheckBox ());
}
void Case3 (DataControlFieldCell cell)
{
Content content = new Content ();
CheckBox checkBox = new CheckBox();
checkBox.ToolTip = "Dummy";
content.Controls.Add(checkBox);
checkBox.DataBinding += OnDataBindField;
cell.Controls.Add (content);
}
void Case4 (DataControlFieldCell cell)
{
CheckBox checkBox = new CheckBox();
checkBox.ToolTip = "Dummy";
cell.Controls.Add(checkBox);
ListBox lb = new ListBox ();
lb.DataBinding += OnDataBindField;
cell.Controls.Add(lb);
}
void Case5 (DataControlFieldCell cell)
{
cell.Controls.Add (new ListBox ());
}
void Case6 (DataControlFieldCell cell)
{
cell.Controls.Add (new ListBox ());
cell.Controls.Add (new CheckBox ());
}
void Case7 (DataControlFieldCell cell)
{
cell.Controls.Add (new CheckBox ());
cell.Controls.Add (new ListBox ());
}
}
}

View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web;
using System.Web.UI.WebControls;
namespace MonoTests.Controls
{
[Flags]
public enum EnumConverterTestValues
{
FlagOne = 0x01,
FlagTwo = 0x02
}
public class EnumConverterTestValuesConverter : EnumConverter
{
public EnumConverterTestValuesConverter (Type type)
: base (type)
{ }
}
public class EnumConverterTextBox : TextBox
{
EnumConverterTestValues values;
[TypeConverter (typeof (EnumConverterTestValuesConverter))]
public EnumConverterTestValues Values {
get { return values; }
set { values = value; }
}
public EnumConverterTextBox ()
{
}
protected override void OnInit (EventArgs e)
{
base.OnInit (e);
Text = values.ToString ();
}
}
}

View File

@ -0,0 +1,36 @@
// Bug #594238
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TestNamedHolders
{
public class MyContainer : WebControl, INamingContainer
{
Control whereTheChildrenPlay;
// can't do this if it is an INamingContainer
public override ControlCollection Controls
{
get { return whereTheChildrenPlay.Controls; }
}
public MyContainer()
{
whereTheChildrenPlay = new Content();
whereTheChildrenPlay.ID = "children";
}
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
// would normally put other stuff here
base.Controls.Add(whereTheChildrenPlay);
// and possibly here
}
}
}