You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
@@ -1109,24 +1109,24 @@ namespace System.Web.UI.WebControls
|
||||
return style;
|
||||
}
|
||||
|
||||
protected override int CreateChildControls (IEnumerable data, bool dataBinding)
|
||||
protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
|
||||
{
|
||||
PagedDataSource dataSource = new PagedDataSource ();
|
||||
dataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? data : null;
|
||||
dataSource.AllowPaging = AllowPaging;
|
||||
dataSource.PageSize = 1;
|
||||
dataSource.CurrentPageIndex = PageIndex;
|
||||
PagedDataSource pagedDataSource = new PagedDataSource ();
|
||||
pagedDataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? dataSource : null;
|
||||
pagedDataSource.AllowPaging = AllowPaging;
|
||||
pagedDataSource.PageSize = 1;
|
||||
pagedDataSource.CurrentPageIndex = PageIndex;
|
||||
|
||||
if (dataBinding && CurrentMode != DetailsViewMode.Insert) {
|
||||
DataSourceView view = GetData ();
|
||||
if (view != null && view.CanPage) {
|
||||
dataSource.AllowServerPaging = true;
|
||||
pagedDataSource.AllowServerPaging = true;
|
||||
if (SelectArguments.RetrieveTotalRowCount)
|
||||
dataSource.VirtualCount = SelectArguments.TotalRowCount;
|
||||
pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
bool showPager = AllowPaging && (dataSource.PageCount > 1);
|
||||
bool showPager = AllowPaging && (pagedDataSource.PageCount > 1);
|
||||
|
||||
Controls.Clear ();
|
||||
table = CreateTable ();
|
||||
@@ -1140,19 +1140,19 @@ namespace System.Web.UI.WebControls
|
||||
// Gets the current data item
|
||||
|
||||
if (AllowPaging) {
|
||||
PageCount = dataSource.DataSourceCount;
|
||||
PageCount = pagedDataSource.DataSourceCount;
|
||||
if (PageIndex >= PageCount && PageCount > 0)
|
||||
pageIndex = dataSource.CurrentPageIndex = PageCount - 1;
|
||||
if (dataSource.DataSource != null) {
|
||||
IEnumerator e = dataSource.GetEnumerator ();
|
||||
pageIndex = pagedDataSource.CurrentPageIndex = PageCount - 1;
|
||||
if (pagedDataSource.DataSource != null) {
|
||||
IEnumerator e = pagedDataSource.GetEnumerator ();
|
||||
if (e.MoveNext ())
|
||||
dataItem = e.Current;
|
||||
}
|
||||
} else {
|
||||
int page = 0;
|
||||
object lastItem = null;
|
||||
if (dataSource.DataSource != null) {
|
||||
IEnumerator e = dataSource.GetEnumerator ();
|
||||
if (pagedDataSource.DataSource != null) {
|
||||
IEnumerator e = pagedDataSource.GetEnumerator ();
|
||||
for (; e.MoveNext (); page++) {
|
||||
lastItem = e.Current;
|
||||
if (page == PageIndex)
|
||||
@@ -1202,7 +1202,7 @@ namespace System.Web.UI.WebControls
|
||||
if (showPager && PagerSettings.Position == PagerPosition.Top ||
|
||||
PagerSettings.Position == PagerPosition.TopAndBottom) {
|
||||
topPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
|
||||
InitializePager (topPagerRow, dataSource);
|
||||
InitializePager (topPagerRow, pagedDataSource);
|
||||
table.Rows.Add (topPagerRow);
|
||||
}
|
||||
|
||||
@@ -1229,7 +1229,7 @@ namespace System.Web.UI.WebControls
|
||||
if (showPager && PagerSettings.Position == PagerPosition.Bottom ||
|
||||
PagerSettings.Position == PagerPosition.TopAndBottom) {
|
||||
bottomPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
|
||||
InitializePager (bottomPagerRow, dataSource);
|
||||
InitializePager (bottomPagerRow, pagedDataSource);
|
||||
table.Rows.Add (bottomPagerRow);
|
||||
}
|
||||
}
|
||||
@@ -1268,7 +1268,7 @@ namespace System.Web.UI.WebControls
|
||||
return rstate;
|
||||
}
|
||||
|
||||
protected virtual void InitializePager (DetailsViewRow row, PagedDataSource dataSource)
|
||||
protected virtual void InitializePager (DetailsViewRow row, PagedDataSource pagedDataSource)
|
||||
{
|
||||
TableCell cell = new TableCell ();
|
||||
cell.ColumnSpan = 2;
|
||||
@@ -1276,7 +1276,7 @@ namespace System.Web.UI.WebControls
|
||||
if (pagerTemplate != null)
|
||||
pagerTemplate.InstantiateIn (cell);
|
||||
else
|
||||
cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
|
||||
cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
|
||||
|
||||
row.Cells.Add (cell);
|
||||
}
|
||||
@@ -1349,7 +1349,7 @@ namespace System.Web.UI.WebControls
|
||||
return dic;
|
||||
}
|
||||
|
||||
protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includePrimaryKey)
|
||||
protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includeKeys)
|
||||
{
|
||||
foreach (DetailsViewRow row in Rows) {
|
||||
if (row.Cells.Count < 1)
|
||||
@@ -1358,7 +1358,7 @@ namespace System.Web.UI.WebControls
|
||||
if (c != null)
|
||||
c.ContainingField.ExtractValuesFromCell (fieldValues, c, row.RowState, includeReadOnlyFields);
|
||||
}
|
||||
if (!includePrimaryKey && DataKeyNames != null)
|
||||
if (!includeKeys && DataKeyNames != null)
|
||||
foreach (string key in DataKeyNames)
|
||||
fieldValues.Remove (key);
|
||||
}
|
||||
@@ -1595,9 +1595,9 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
}
|
||||
public
|
||||
void SetPageIndex (int newIndex)
|
||||
void SetPageIndex (int index)
|
||||
{
|
||||
DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);
|
||||
DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (index);
|
||||
OnPageIndexChanging (args);
|
||||
|
||||
if (args.Cancel || !IsBoundUsingDataSourceID)
|
||||
@@ -1764,11 +1764,11 @@ namespace System.Web.UI.WebControls
|
||||
RequireBinding ();
|
||||
}
|
||||
|
||||
protected internal override void LoadControlState (object ob)
|
||||
protected internal override void LoadControlState (object savedState)
|
||||
{
|
||||
if (ob == null)
|
||||
if (savedState == null)
|
||||
return;
|
||||
object[] state = (object[]) ob;
|
||||
object[] state = (object[]) savedState;
|
||||
base.LoadControlState (state[0]);
|
||||
pageIndex = (int) state[1];
|
||||
pageCount = (int) state[2];
|
||||
@@ -1900,14 +1900,14 @@ namespace System.Web.UI.WebControls
|
||||
ControlStyle.LoadViewState (states [12]);
|
||||
}
|
||||
|
||||
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
|
||||
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
|
||||
{
|
||||
RaiseCallbackEvent (eventArgs);
|
||||
RaiseCallbackEvent (eventArgument);
|
||||
}
|
||||
|
||||
protected virtual void RaiseCallbackEvent (string eventArgs)
|
||||
protected virtual void RaiseCallbackEvent (string eventArgument)
|
||||
{
|
||||
string[] clientData = eventArgs.Split ('|');
|
||||
string[] clientData = eventArgument.Split ('|');
|
||||
PageIndex = int.Parse (clientData[0]);
|
||||
|
||||
RaisePostBackEvent (clientData[1]);
|
||||
|
||||
Reference in New Issue
Block a user