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,5 @@
<%@ Control Language="C#" CodeFile="FilterUserControl.ascx.cs" Inherits="FilterUserControl" %>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" EnableViewState="true" CssClass="droplist">
<asp:ListItem Text="All" Value="" />
</asp:DropDownList>

View File

@ -0,0 +1,41 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
public partial class FilterUserControl : System.Web.DynamicData.FilterUserControlBase {
public event EventHandler SelectedIndexChanged {
add {
DropDownList1.SelectedIndexChanged += value;
}
remove {
DropDownList1.SelectedIndexChanged -= value;
}
}
public override string SelectedValue {
get {
return DropDownList1.SelectedValue;
}
}
protected void Page_Init(object sender, EventArgs e) {
if (!Page.IsPostBack) {
PopulateListControl(DropDownList1);
// Set the initial value if there is one
if (!String.IsNullOrEmpty(InitialValue))
DropDownList1.SelectedValue = InitialValue;
}
}
}

View File

@ -0,0 +1,27 @@
<%@ Control Language="C#" CodeFile="GridViewPager.ascx.cs" Inherits="GridViewPager" %>
<div class="pager">
<span class="results1">
<asp:ImageButton AlternateText="First page" ToolTip="First page" ID="ImageButtonFirst" runat="server" ImageUrl="Images/PgFirst.gif" Width="8" Height="9" CommandName="Page" CommandArgument="First" />
&nbsp;
<asp:ImageButton AlternateText="Previous page" ToolTip="Previous page" ID="ImageButtonPrev" runat="server" ImageUrl="Images/PgPrev.gif" Width="5" Height="9" CommandName="Page" CommandArgument="Prev" />
&nbsp;
<asp:Label ID="LabelPage" runat="server" Text="Page " AssociatedControlID="TextBoxPage" />
<asp:TextBox ID="TextBoxPage" runat="server" Columns="5" AutoPostBack="true" ontextchanged="TextBoxPage_TextChanged" Width="20px" CssClass="droplist" />
of
<asp:Label ID="LabelNumberOfPages" runat="server" />
&nbsp;
<asp:ImageButton AlternateText="Next page" ToolTip="Next page" ID="ImageButtonNext" runat="server" ImageUrl="Images/PgNext.gif" Width="5" Height="9" CommandName="Page" CommandArgument="Next" />
&nbsp;
<asp:ImageButton AlternateText="Last page" ToolTip="Last page" ID="ImageButtonLast" runat="server" ImageUrl="Images/PgLast.gif" Width="8" Height="9" CommandName="Page" CommandArgument="Last" />
</span>
<span class="results2">
<asp:Label ID="LabelRows" runat="server" Text="Results per page:" AssociatedControlID="DropDownListPageSize" />
<asp:DropDownList ID="DropDownListPageSize" runat="server" AutoPostBack="true" CssClass="droplist" onselectedindexchanged="DropDownListPageSize_SelectedIndexChanged">
<asp:ListItem Value="5" />
<asp:ListItem Value="10" />
<asp:ListItem Value="15" />
<asp:ListItem Value="20" />
</asp:DropDownList>
</span>
</div>

View File

@ -0,0 +1,68 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
public partial class GridViewPager : System.Web.UI.UserControl {
private GridView _gridView;
protected void Page_Load(object sender, EventArgs e) {
Control c = Parent;
while (c != null) {
if (c is GridView) {
_gridView = (GridView)c;
break;
}
c = c.Parent;
}
}
protected void TextBoxPage_TextChanged(object sender, EventArgs e) {
if (_gridView == null) {
return;
}
int page;
if (int.TryParse(TextBoxPage.Text.Trim(), out page)) {
if (page <= 0) {
page = 1;
}
if (page > _gridView.PageCount) {
page = _gridView.PageCount;
}
_gridView.PageIndex = page - 1;
}
TextBoxPage.Text = (_gridView.PageIndex + 1).ToString();
}
protected void DropDownListPageSize_SelectedIndexChanged(object sender, EventArgs e) {
if (_gridView == null) {
return;
}
DropDownList dropdownlistpagersize = (DropDownList)sender;
_gridView.PageSize = Convert.ToInt32(dropdownlistpagersize.SelectedValue);
int pageindex = _gridView.PageIndex;
_gridView.DataBind();
if (_gridView.PageIndex != pageindex) {
//if page index changed it means the previous page was not valid and was adjusted. Rebind to fill control with adjusted page
_gridView.DataBind();
}
}
protected void Page_PreRender(object sender, EventArgs e) {
if (_gridView != null) {
LabelNumberOfPages.Text = _gridView.PageCount.ToString();
TextBoxPage.Text = (_gridView.PageIndex + 1).ToString();
DropDownListPageSize.SelectedValue = _gridView.PageSize.ToString();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

View File

@ -0,0 +1,3 @@
<%@ Control Language="C#" CodeFile="Boolean.ascx.cs" Inherits="BooleanField" %>
<span class="field"><%= Column.Name %></span>: <asp:CheckBox runat="server" ID="CheckBox1" Enabled="false" />

View File

@ -0,0 +1,30 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
public partial class BooleanField : System.Web.DynamicData.FieldTemplateUserControl {
protected override void OnDataBinding(EventArgs e) {
base.OnDataBinding(e);
object val = FieldValue;
if (val != null)
CheckBox1.Checked = (bool) val;
}
public override Control DataControl {
get {
return CheckBox1;
}
}
}

View File

@ -0,0 +1,3 @@
<%@ Control Language="C#" CodeFile="Boolean_Edit.ascx.cs" Inherits="Boolean_EditField" %>
<asp:CheckBox runat="server" ID="CheckBox1" />

View File

@ -0,0 +1,34 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
public partial class Boolean_EditField : System.Web.DynamicData.FieldTemplateUserControl {
protected override void OnDataBinding(EventArgs e) {
base.OnDataBinding(e);
object val = FieldValue;
if (val != null)
CheckBox1.Checked = (bool) val;
}
protected override void ExtractValues(IOrderedDictionary dictionary) {
dictionary[Column.Name] = CheckBox1.Checked;
}
public override Control DataControl {
get {
return CheckBox1;
}
}
}

View File

@ -0,0 +1,3 @@
<%@ Control Language="C#" CodeFile="Children.ascx.cs" Inherits="ChildrenField" %>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="<%# GetChildrenPath() %>" />

View File

@ -0,0 +1,62 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
using MonoTests.Common;
public partial class ChildrenField : PokerFieldTemplateUserControl {
private bool _allowNavigation = true;
private string _navigateUrl;
public string NavigateUrl {
get {
return _navigateUrl;
}
set {
_navigateUrl = value;
}
}
public bool AllowNavigation {
get {
return _allowNavigation;
}
set {
_allowNavigation = value;
}
}
protected void Page_Load(object sender, EventArgs e) {
HyperLink1.Text = "View " + ChildrenColumn.ChildTable.DisplayName;
}
protected string GetChildrenPath() {
if (!AllowNavigation) {
return null;
}
if (String.IsNullOrEmpty(NavigateUrl)) {
return ChildrenPath;
}
else {
return BuildChildrenPath(NavigateUrl);
}
}
public override Control DataControl {
get {
return HyperLink1;
}
}
}

View File

@ -0,0 +1,3 @@
<%@ Control Language="C#" CodeFile="CustomColor.ascx.cs" Inherits="CustomColorField" %>
<span class="field"><%= Column.Name %></span>: <span class="customColorTemplate"><asp:Literal runat="server" ID="Literal1" Text="<%# FieldValueString %>" /></span>

View File

@ -0,0 +1,32 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
public partial class CustomColorField : System.Web.DynamicData.FieldTemplateUserControl
{
public override Control DataControl {
get { return Literal1; }
}
public override string FieldValueString {
get {
var color = (Color)FieldValue;
if (color == null)
return "Unknown";
return color.Name;
}
}
}

View File

@ -0,0 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CustomFieldTemplate.ascx.cs" Inherits="DynamicData_FieldTemplates_CustomFieldTemplate" %>
<span class="field"><%= Column.Name %></span>: <span class="customFieldTemplate"><asp:Literal runat="server" ID="Literal1" Text="<%# FieldValueString %>" /></span>

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