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,313 @@
2010-06-19 Marek Habersack <mhabersack@novell.com>
* DataPager.cs: when rendering the ID attribute, use ClientID
2010-06-18 Marek Habersack <mhabersack@novell.com>
* NumericPagerField.cs: CreateDataPagers outputs correct page
number in query mode. Fixes bug #615315
Rendering changes to match .NET
* DataPagerField.cs: if query string has been handled and query
mode is in effect, return true. Fixes bug #615315
2010-05-18 Marek Habersack <mhabersack@novell.com>
* ListView.cs: if data source has pageable data, get total count
from the source's DataSourceCount property. Fixes bug #604053
2009-12-15 Marek Habersack <mhabersack@novell.com>
* NextPreviousPagerField.cs: HandleEvent doesn't call
DataPager.SetPageProperties with negative start index. Also, if
_totalRowCount is <= 0, new start index is not calculated using
it. Fixes bug #545417
* ListViewPagedDataSource.cs: when server paging is on, data items
are counted from index 0 instead of from the value stored in
StartRowIndex. Fixes bug #545417
* ListView.cs: CreateChildControls doesn't create empty data item
if called with fake data.
When a view reports it can page data, ListViewPagedDataSource
passed to item creation methods has AllowServerPaging set to
true. Fixes bug #545417
When CreateChildControls is called with fake data,
ListViewPagedDataSource has its TotalRowCount property set to the
actual total row count, not zero. Fixes bug #545417
2009-09-15 Marek Habersack <mhabersack@novell.com>
* ListView.cs: CreateChildControls calls EnsureDataBound only if
we're not in post-back and if data binding is required.
2009-09-08 Marek Habersack <mhabersack@novell.com>
* ListView.cs: if total row count has been retrieved from the
view, don't reset it to the number of items returned from the data
source. Fixes bug #535701
2009-09-01 Marek Habersack <mhabersack@novell.com>
* ListView.cs: LoadControlState must call OnTotalRowCountAvailable
after restoring the state, so that all parties subscribed to that
event are given chance to react accordingly.
SetPageProperties should use values stored in
PagePropertiesChangingEventArgs arguments after handler returns.
2009-06-25 Marek Habersack <mhabersack@novell.com>
* LinqDataSource.cs: make ContextType not throw an exception when
ContextTypeName is not set, but rather return a null in that
case.
2009-03-03 Marek Habersack <mhabersack@novell.com>
* ListView.cs: SetPageProperties invoked the
PagePropertiesChanging event with the startRowIndex and
maximumRows parameters reversed. Fixes bugs #481250 and #481252
* DataPagerField.cs: GetQueryModeStartRowIndex must return 'true'
if in query mode. Fixes bug #481248
2008-11-28 Marek Habersack <mhabersack@novell.com>
* ListView.cs: use the _correct_ operator when checking whether
selected item index is within the data keys range.
2008-11-27 Marek Habersack <mhabersack@novell.com>
* ListView.cs: fixes in DoUpdate and DoDelete - check must be made
that the requested item index is _smaller_ than the number of
keys, not _bigger_.
Enable using the lambda expression in CreateItemsInGroups - the
gmcs bug preventing that was fixed.
2008-11-20 Marek Habersack <mhabersack@novell.com>
* ListView.cs: implemented the EditItem property.
Use ConvertEmptyStringToNull in ExtractItemValues.
2008-11-19 Marek Habersack <mhabersack@novell.com>
* ListView.cs: added paremeter checks to AddControlToContainer.
CreateInsertItem must instantiate the template and call raise the
ItemCreated event.
Added parameter checks to FindPlaceholder
2008-11-18 Marek Habersack <mhabersack@novell.com>
* ListViewContainer.cs: added
* ListView.cs: implemented grouping support. With this ListView is
feature complete.
Refactored grouped/non-grouped rendering common code into separate
methods.
FindPlaceholder now looks for the placeholder recursively.
Implemented forgotten UpdateItem method.
Align group with empty items if there are no more data items.
Each group is contained within ListViewContainer.
* ListViewTableCell.cs: added
2008-11-15 Marek Habersack <mhabersack@novell.com>
* ListViewInsertEventArgs.cs: implemented the Values property.
* ListView.cs: CreateChildControls uses the Items collection to
store the created items.
InsertNewItem triggers page validation if necessary.
Part of InsertNewItem code refactored to DoInsert.
Implemented handling of the Insert and Select commands.
* TemplatePagerField.cs: implemented all the code.
* DataPager.cs: CreatePagerFields now adds the new pager field
control before creating data pagers in it and before binding to
data. This avoids situation in which the field is parentless.
FindPageableItemContainer now properly finds the container if it's
placed directly in the Page.
{Load,Save}ViewState don't use a Pair anymore, object array is
used for compatibility with MS.NET
* NumericPagerField.cs, NextPreviousPagerField.cs,
DataPagerFieldCommandEventArgs.cs: minor refactoring
* ListViewSelectEventArgs.cs: implemented all the code.
* ListViewInsertedEventArgs.cs: Values allocates the dictionary on
demand now.
Initialize all the properties in constructor
* DataPagerCommandEventArgs.cs: added
* DataPagerField.cs: implemented IsTrackingViewState
* DataPagerFieldItem.cs: implements the INonBindingContainer
interface.
2008-11-13 Marek Habersack <mhabersack@novell.com>
* ListView.cs: implemented support for Edit, Update and Delete.
Implemented ExtractItemValues.
* ListViewDataItem.cs, ListViewItem.cs: implemented OnBubbleEvent.
* ListViewDeletedEventArgs.cs, ListViewUpdateEventArgs.cs,
ListViewEditEventArgs.cs, ListViewCancelEventArgs.cs,
ListViewDeleteEventArgs.cs, ListViewUpdatedEventArgs.cs:
implemented all the properties and methods.
* HelperExtensions.cs: added
2008-11-06 Marek Habersack <mhabersack@novell.com>
* ListView.cs: implemented the sorting capability.
* ListViewSortEventArgs.cs: implemented all the methods and
properties.
2008-11-01 Marek Habersack <mhabersack@novell.com>
* ListView.cs: do not instantiate the layout template more than
necessary.
* NextPreviousPagerField.cs: moved some common code to the base
class (the GetQueryModeStartRowIndex method)
* DataPager.cs: do not call SetPageProperties more than
necessary.
* NumericPagerField.cs: implemented
* DataPagerField.cs: added a helper method,
GetQueryModeStartRowIndex, to be used by all the concrete
implementations to calculate the starting row index in the query
mode.
2008-10-31 Marek Habersack <mhabersack@novell.com>
* ListView.cs: use StartRowIndex and MaximumRows properties when
calculating the total row count server paging case and when
assigning to corresponding properties of the paged data source.
2008-10-30 Marek Habersack <mhabersack@novell.com>
* DataPagerFieldCollection.cs: implemented most of the methods and
properties, so that using the DataPager is possible now.
* PagePropertiesChangingEventArgs.cs: implemented all the methods
and properties.
* ListView.cs: {Save,Load}ControlState now uses constants to index
state arrays. Total row count is stored in the control state.
CreateChildControls () now uses dummy data to initialize child
controls if no items were found after postback.
CreateChildControls (IEnumerable, bool) now properly calculates
total row count, calls OnTotalRowCountAvailable after creating the
child controls and returns the total row count instead of the
number of created child controls. This makes pager work
correctly.
Implemented SetPageProperties () to support paging.
* NextPreviousPagerField.cs: Correctly order the Next/Previous
buttons.
When creating buttons, cast the new control properly before
assigning properties.
* TemplatePagerField.cs: added (stub)
* DataPager.cs: added missing class attributes (ParseChildren,
PersistChildren and SupportsEventValidation).
{Save,Load}ControlState now use constants to index the state
arrays.
Properly implemented FindPageableItemContainer - it now looks for
the container up the parenthood chain, querying all the naming
containers for the named control.
SetUpForNewContainer now accepts an additional parameter, so that
the SetPageProperties method is called on the container whenever
necessary.
* NumericPagerField.cs: implemented the CreateField method.
* ListViewPagedDataSource.cs: implemented data source
enumerators.
* DataPagerFieldItem.cs: implemented all the methods and properties.
2008-10-21 Atsushi Enomoto <atsushi@ximian.com>
* LinqDataSource.cs : set ContextTypeName too when ContextType is set.
2008-10-09 Atsushi Enomoto <atsushi@ximian.com>
* LinqDataSource.cs : implement ContextType/ContextTypeName.
* LinqDataSourceView.cs : some ExecuteSelect() implementation.
Cache type members which are from reflection.
2008-10-08 Atsushi Enomoto <atsushi@ximian.com>
* LinqDataSource.cs, LinqDataSourceView.cs :
some more implementation.
2008-09-30 Marek Habersack <mhabersack@novell.com>
* ListView.cs: implemented all the events.
CreateChildControls works with non-ICollection data sources now.
CreateItemsWithoutGroups now counts items placed in the container
and stores the container in a field, so that RemoveItems can
properly delete the child controls.
Implemented the RemoveItems method.
Implemented Load/SaveControlState.
Implemented LoadViewState.
Implemented OnBubbleEvent.
Implemented all the On* methods.
* ListViewCommandEventArgs.cs: implemented the CommandSource and
Item properties.
* ListViewItemEventArgs.cs: implemented the Item property.
2008-09-18 Atsushi Enomoto <atsushi@ximian.com>
* LinqDataSource.cs, LinqDataSourceView.cs
LinqDataSourceContextEventArgs.cs
LinqDataSourceDeleteEventArgs.cs
LinqDataSourceDisposeEventArgs.cs
LinqDataSourceInsertEventArgs.cs
LinqDataSourceSelectEventArgs.cs
LinqDataSourceStatusEventArgs.cs
LinqDataSourceUpdateEventArgs.cs : easy implementation parts.
2008-09-18 Atsushi Enomoto <atsushi@ximian.com>
* LinqDataSource.cs, LinqDataSourceView.cs
LinqDataSourceContextEventArgs.cs
LinqDataSourceDeleteEventArgs.cs
LinqDataSourceDisposeEventArgs.cs
LinqDataSourceInsertEventArgs.cs
LinqDataSourceSelectEventArgs.cs
LinqDataSourceStatusEventArgs.cs
LinqDataSourceUpdateEventArgs.cs
LinqDataSourceValidationException.cs : stubbed out.
2008-05-08 Marek Habersack <mhabersack@novell.com>
* DataPager.cs, DataPager.cs, DataPagerFieldCollection.cs,
DataPagerFieldCommandEventArgs.cs, DataPagerField.cs,
DataPagerFieldItem.cs, InsertItemPosition.cs,
IPageableItemContainer.cs, ListViewCancelEventArgs.cs,
ListViewCancelMode.cs, ListViewCommandEventArgs.cs, ListView.cs,
ListViewDataItem.cs, ListViewDeletedEventArgs.cs,
ListViewDeleteEventArgs.cs, ListViewEditEventArgs.cs,
ListViewInsertedEventArgs.cs, ListViewInsertEventArgs.cs,
ListViewItem.cs, ListViewItemEventArgs.cs, ListViewItemType.cs,
ListViewPagedDataSource.cs, ListViewSelectEventArgs.cs,
ListViewSortEventArgs.cs, ListViewTableRow.cs,
ListViewUpdatedEventArgs.cs, ListViewUpdateEventArgs.cs,
NextPreviousPagerField.cs, NumericPagerField.cs, PageEventArgs.cs,
PagePropertiesChangingEventArgs.cs, TemplatePagerField.cs:
added. NOTE: this is code in progress! It is not fully implemented
and usable, please do not file bug reports for the code - patches
are gladly accepted :)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
//
// System.Web.UI.WebControls.DataPager
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Security.Permissions;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DataPagerCommandEventArgs : CommandEventArgs
{
public DataPagerFieldItem Item {
get;
private set;
}
public int NewMaximumRows {
get;
set;
}
public int NewStartRowIndex {
get;
set;
}
public DataPagerField PagerField {
get;
private set;
}
public int TotalRowCount {
get;
private set;
}
public DataPagerCommandEventArgs (DataPagerField pagerField, int totalRowCount, CommandEventArgs originalArgs, DataPagerFieldItem item)
: base (originalArgs)
{
Item = item;
NewMaximumRows = -1;
NewStartRowIndex = -1;
PagerField = pagerField;
TotalRowCount = totalRowCount;
}
}
}
#endif

View File

@@ -0,0 +1,270 @@
//
// System.Web.UI.WebControls.DataPagerField
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007-2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Security.Permissions;
using System.Text;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class DataPagerField : IStateManager
{
static readonly object FieldChangedEvent = new object ();
EventHandlerList events;
StateBag _state = new StateBag ();
DataPager _dataPager;
bool _queryStringHandled;
bool _isTrackingViewState;
string _queryStringNavigateUrl;
internal event EventHandler FieldChanged {
add { AddEventHandler (FieldChangedEvent, value); }
remove { RemoveEventHandler (FieldChangedEvent, value); }
}
protected DataPagerField ()
{
}
protected internal DataPagerField CloneField ()
{
DataPagerField ret = CreateField ();
CopyProperties (ret);
return ret;
}
protected virtual void CopyProperties (DataPagerField newField)
{
// assuming we should copy only the public properties
newField.Visible = Visible;
}
public abstract void CreateDataPagers (DataPagerFieldItem container, int startRowIndex, int maximumRows,
int totalRowCount, int fieldIndex);
protected abstract DataPagerField CreateField ();
protected string GetQueryStringNavigateUrl (int pageNumber)
{
if (_queryStringNavigateUrl == null && _dataPager != null) {
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
string queryFieldName = _dataPager.QueryStringField;
if (req != null) {
StringBuilder sb = new StringBuilder (req.Path + "?");
NameValueCollection coll = req.QueryString;
foreach (string k in coll.AllKeys) {
if (String.Compare (k, queryFieldName, StringComparison.OrdinalIgnoreCase) == 0)
continue;
sb.Append (HttpUtility.UrlEncode (k) + "=" + HttpUtility.UrlEncode (coll [k]) + "&");
}
sb.Append (queryFieldName + "=");
_queryStringNavigateUrl = sb.ToString ();
} else
_queryStringNavigateUrl = String.Empty;
}
return _queryStringNavigateUrl + pageNumber.ToString (CultureInfo.InvariantCulture);
}
public abstract void HandleEvent (CommandEventArgs e);
protected virtual void LoadViewState (Object savedState)
{
if (savedState == null)
return;
((IStateManager) ViewState).LoadViewState (savedState);
}
protected virtual void OnFieldChanged ()
{
InvokeEvent (FieldChangedEvent, EventArgs.Empty);
}
protected virtual object SaveViewState ()
{
return ((IStateManager) ViewState).SaveViewState ();
}
protected virtual void TrackViewState ()
{
_isTrackingViewState = true;
((IStateManager)ViewState).TrackViewState ();
}
protected DataPager DataPager {
get { return _dataPager; }
}
protected bool QueryStringHandled {
get { return _queryStringHandled; }
set { _queryStringHandled = value; }
}
protected string QueryStringValue {
get {
if (_dataPager == null)
return String.Empty;
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
if (req == null)
return String.Empty;
return req.QueryString [_dataPager.QueryStringField];
}
}
protected StateBag ViewState {
get { return _state; }
}
public bool Visible {
get {
object o = ViewState ["Visible"];
if (o == null)
return true;
return (bool) o;
}
set {
if (value != Visible) {
ViewState ["Visible"] = value;
OnFieldChanged ();
}
}
}
protected bool IsTrackingViewState {
get { return _isTrackingViewState; }
}
void IStateManager.TrackViewState ()
{
TrackViewState ();
}
bool IStateManager.IsTrackingViewState {
get { return IsTrackingViewState; }
}
object IStateManager.SaveViewState ()
{
return SaveViewState ();
}
void IStateManager.LoadViewState (object state)
{
LoadViewState (state);
}
internal void SetDataPager (DataPager pager)
{
_dataPager = pager;
}
internal bool GetQueryModeStartRowIndex (int totalRowCount, int maximumRows, ref int startRowIndex, ref bool setPagePropertiesNeeded)
{
bool queryMode = !String.IsNullOrEmpty (DataPager.QueryStringField);
if (!queryMode || QueryStringHandled)
return queryMode;
QueryStringHandled = true;
// We need to calculate the new start index since it is probably out
// of date because the GET parameter with the page number hasn't
// been processed yet
int pageNumber;
try {
pageNumber = Int32.Parse (QueryStringValue);
} catch {
// ignore
pageNumber = -1;
}
if (pageNumber >= 0) {
pageNumber--; // we're zero-based since we're calculating
// the offset/index
if (pageNumber >= 0) {
// zero-based calculation again
int pageCount = (totalRowCount - 1) / maximumRows;
if (pageNumber <= pageCount) {
startRowIndex = pageNumber * maximumRows;
setPagePropertiesNeeded = true;
}
}
}
return true;
}
void AddEventHandler (object key, EventHandler handler)
{
if (events == null)
events = new EventHandlerList ();
events.AddHandler (key, handler);
}
void RemoveEventHandler (object key, EventHandler handler)
{
if (events == null)
return;
events.RemoveHandler (key, handler);
}
void InvokeEvent (object key, EventArgs args)
{
if (events == null)
return;
EventHandler eh = events [key] as EventHandler;
if (eh == null)
return;
eh (this, args);
}
}
}
#endif

View File

@@ -0,0 +1,204 @@
//
// System.Web.UI.WebControls.DataPagerFieldCollection
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007-2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DataPagerFieldCollection : StateManagedCollection
{
enum KnownTypeIndexes
{
NextPreviousPagerField = 0,
NumericPagerField = 1,
TemplatePagerField = 2
}
static readonly Type[] knownTypes = {
typeof (NextPreviousPagerField),
typeof (NumericPagerField),
typeof (TemplatePagerField)
};
static readonly object FieldsChangedEvent = new object ();
IList list;
DataPager owner;
EventHandlerList events;
public event EventHandler FieldsChanged {
add { AddEventHandler (FieldsChangedEvent, value); }
remove { RemoveEventHandler (FieldsChangedEvent, value); }
}
public DataPagerFieldCollection (DataPager dataPager)
{
list = (IList)this;
owner = dataPager;
}
public void Add (DataPagerField field)
{
list.Add (field);
}
public DataPagerFieldCollection CloneFields (DataPager pager)
{
throw new NotImplementedException ();
}
public bool Contains (DataPagerField field)
{
return list.Contains (field);
}
public void CopyTo (DataPagerField[] array, int index)
{
}
protected override object CreateKnownType (int index)
{
if (!Enum.IsDefined (typeof (KnownTypeIndexes), index))
throw new ArgumentOutOfRangeException ("index");
return Activator.CreateInstance (knownTypes [index]);
}
protected override Type[] GetKnownTypes ()
{
return knownTypes;
}
public int IndexOf (DataPagerField field)
{
return list.IndexOf (field);
}
public void Insert (int index, DataPagerField field)
{
list.Insert (index, field);
}
protected override void OnClearComplete ()
{
base.OnClearComplete ();
InvokeEvent (FieldsChangedEvent, EventArgs.Empty);
}
protected override void OnInsertComplete (int index, object value)
{
base.OnInsertComplete (index, value);
DataPagerField field = value as DataPagerField;
if (field == null)
return;
field.SetDataPager (owner);
field.FieldChanged += new EventHandler (FieldHasChanged);
InvokeEvent (FieldsChangedEvent, EventArgs.Empty);
}
protected override void OnRemoveComplete (int index, object value)
{
base.OnRemoveComplete (index, value);
DataPagerField field = value as DataPagerField;
if (field == null)
return;
field.SetDataPager (null);
field.FieldChanged -= new EventHandler (FieldHasChanged);
InvokeEvent (FieldsChangedEvent, EventArgs.Empty);
}
protected override void OnValidate (object o)
{
base.OnValidate (o);
DataPagerField field = o as DataPagerField;
if (field == null)
throw new ArgumentException ("is not an instance of the DataPagerField class or of one of its derived classes.", "o");
}
public void Remove (DataPagerField field)
{
list.Remove (field);
}
public void RemoveAt (int index)
{
list.RemoveAt (index);
}
protected override void SetDirtyObject (object o)
{
}
[BrowsableAttribute(false)]
public DataPagerField this [int index] {
get { return list [index] as DataPagerField; }
}
void FieldHasChanged (object sender, EventArgs args)
{
InvokeEvent (FieldsChangedEvent, EventArgs.Empty);
}
void AddEventHandler (object key, EventHandler handler)
{
if (events == null)
events = new EventHandlerList ();
events.AddHandler (key, handler);
}
void RemoveEventHandler (object key, EventHandler handler)
{
if (events == null)
return;
events.RemoveHandler (key, handler);
}
void InvokeEvent (object key, EventArgs args)
{
if (events == null)
return;
EventHandler eh = events [key] as EventHandler;
if (eh == null)
return;
eh (this, args);
}
}
}
#endif

View File

@@ -0,0 +1,61 @@
//
// System.Web.UI.WebControls.ListView
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007-2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DataPagerFieldCommandEventArgs : CommandEventArgs
{
public object CommandSource {
get;
private set;
}
public DataPagerFieldItem Item {
get;
private set;
}
public DataPagerFieldCommandEventArgs (DataPagerFieldItem item, object commandSource, CommandEventArgs originalArgs)
: base (originalArgs)
{
Item = item;
CommandSource = commandSource;
}
}
}
#endif

View File

@@ -0,0 +1,73 @@
//
// System.Web.UI.WebControls.DataPagerField
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007-2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DataPagerFieldItem : Control, INamingContainer, INonBindingContainer
{
public DataPagerFieldItem (DataPagerField field, DataPager pager)
{
Pager = pager;
PagerField = field;
}
protected override bool OnBubbleEvent (object source, EventArgs e)
{
CommandEventArgs args = e as CommandEventArgs;
if (args != null) {
RaiseBubbleEvent (this, new DataPagerFieldCommandEventArgs (this, source, args));
return true;
}
return false;
}
public DataPager Pager {
get;
private set;
}
public DataPagerField PagerField {
get;
private set;
}
}
}
#endif

View File

@@ -0,0 +1,49 @@
//
// System.Web.UI.WebControls.ListView
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2008 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections;
using System.Collections.Specialized;
namespace System.Web.UI.WebControls
{
internal static class HelperExtensions
{
public static void CopyTo (this IOrderedDictionary from, IOrderedDictionary to)
{
if (to == null || from.Count == 0)
return;
foreach (DictionaryEntry de in from)
to.Add (de.Key, de.Value);
}
}
}
#endif

View File

@@ -0,0 +1,50 @@
//
// System.Web.UI.WebControls.IPageableItemContainer
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public interface IPageableItemContainer
{
void SetPageProperties(int startRowIndex, int maximumRows, bool databind);
int MaximumRows { get; }
int StartRowIndex { get; }
event EventHandler<PageEventArgs> TotalRowCountAvailable;
}
}
#endif

View File

@@ -0,0 +1,40 @@
//
// System.Web.UI.WebControls.ListView
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2007 Novell, Inc
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
namespace System.Web.UI.WebControls
{
public enum InsertItemPosition
{
None,
FirstItem,
LastItem
}
}
#endif

View File

@@ -0,0 +1,442 @@
//
// LinqDataSource.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.DynamicData;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
// [ToolboxBitmap (typeof (LinqDataSource), "LinqDataSource.ico")]
[PersistChildren (false)]
[ParseChildren (true)]
[Designer ("System.Web.UI.Design.WebControls.LinqDataSourceDesigner, System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")]
[DefaultEvent ("Selecting")]
[ToolboxItemFilter ("System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", ToolboxItemFilterType.Require)]
[DefaultProperty ("ContextTypeName")]
public class LinqDataSource : DataSourceControl, IDynamicDataSource
{
static readonly string [] empty_names = new string [] { "DefaultView" };
public LinqDataSource ()
{
}
protected internal override void OnInit (EventArgs e)
{
Page.LoadComplete += OnPageLoadComplete;
}
void OnPageLoadComplete (object sender, EventArgs e)
{
SelectParameters.UpdateValues (Context, this);
WhereParameters.UpdateValues (Context, this);
GroupByParameters.UpdateValues (Context, this);
OrderByParameters.UpdateValues (Context, this);
OrderGroupsByParameters.UpdateValues (Context, this);
}
protected internal override void OnUnload (EventArgs e)
{
base.OnUnload (e);
// no further things to do?
}
#region View
LinqDataSourceView view;
LinqDataSourceView View {
get {
if (view == null) {
view = CreateView ();
if (IsTrackingViewState)
((IStateManager) view).TrackViewState ();
}
return view;
}
}
protected virtual LinqDataSourceView CreateView ()
{
var view = new LinqDataSourceView (this, Guid.NewGuid ().ToString (), HttpContext.Current);
if (IsTrackingViewState)
((IStateManager) view).TrackViewState ();
return view;
}
protected override DataSourceView GetView (string viewName)
{
if (String.IsNullOrEmpty (viewName) || (String.Compare (viewName, empty_names [0], StringComparison.InvariantCultureIgnoreCase) == 0))
return View;
throw new ArgumentException ("viewName must be 'DefaultView' in LinqDataSource");
}
protected override ICollection GetViewNames ()
{
return empty_names;
}
#endregion
[Category ("Behavior")]
[DefaultValue (false)]
public bool AutoGenerateOrderByClause {
get { return View.AutoGenerateOrderByClause; }
set { View.AutoGenerateOrderByClause = value; }
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool AutoGenerateWhereClause {
get { return View.AutoGenerateWhereClause; }
set { View.AutoGenerateWhereClause = value; }
}
[Category ("Behavior")]
[DefaultValue (true)]
public bool AutoPage {
get { return View.AutoPage; }
set { View.AutoPage = value; }
}
[Category ("Behavior")]
[DefaultValue (true)]
public bool AutoSort {
get { return View.AutoSort; }
set { View.AutoSort = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string ContextTypeName { get; set; }
Type context_type;
[MonoTODO ("looks like we need System.Web.Query.Dynamic stuff or alternative")]
Type IDynamicDataSource.ContextType {
get {
if (context_type != null && context_type.FullName == ContextTypeName)
return context_type;
if (String.IsNullOrEmpty (ContextTypeName))
return null;
// FIXME: retrieve type from BuildProvider or whatever.
context_type = LoadType (ContextTypeName);
if (context_type == null)
throw new ArgumentException (String.Format ("Type '{0}' cannot be loaded", ContextTypeName));
return context_type;
}
set {
if (value == null)
throw new ArgumentNullException ("value");
context_type = value;
ContextTypeName = context_type.FullName;
}
}
private Type LoadType (string name)
{
foreach (var ass in AppDomain.CurrentDomain.GetAssemblies ())
foreach (var type in ass.GetTypes ())
if (type.FullName == name)
return type;
return null;
}
string IDynamicDataSource.EntitySetName {
get { return TableName; }
set { TableName = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string TableName {
get { return View.TableName; }
set { View.TableName = value; }
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool EnableDelete {
get { return View.EnableDelete; }
set { View.EnableDelete = value; }
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool EnableInsert {
get { return View.EnableInsert; }
set { View.EnableInsert = value; }
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool EnableObjectTracking {
get { return View.EnableObjectTracking; }
set { View.EnableObjectTracking = value; }
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool EnableUpdate {
get { return View.EnableUpdate; }
set { View.EnableUpdate = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string GroupBy {
get { return View.GroupBy; }
set { View.GroupBy = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string OrderBy {
get { return View.OrderBy; }
set { View.OrderBy = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string OrderGroupsBy {
get { return View.OrderGroupsBy; }
set { View.OrderGroupsBy = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string Select {
get { return View.SelectNew; }
set { View.SelectNew = value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string Where {
get { return View.Where; }
set { View.Where = value; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[Browsable (false)]
public ParameterCollection SelectParameters {
get { return View.SelectNewParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[Browsable (false)]
[PersistenceMode (PersistenceMode.InnerProperty)]
public ParameterCollection WhereParameters {
get { return View.WhereParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[Browsable (false)]
[PersistenceMode (PersistenceMode.InnerProperty)]
public ParameterCollection GroupByParameters {
get { return View.GroupByParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[Browsable (false)]
[PersistenceMode (PersistenceMode.InnerProperty)]
public ParameterCollection OrderByParameters {
get { return View.OrderByParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[Browsable (false)]
public ParameterCollection OrderGroupsByParameters {
get { return View.OrderGroupsByParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[Browsable (false)]
public ParameterCollection DeleteParameters {
get { return View.DeleteParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[Browsable (false)]
public ParameterCollection InsertParameters {
get { return View.InsertParameters; }
}
[MergableProperty (false)]
[Category ("Data")]
[DefaultValue (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[Browsable (false)]
public ParameterCollection UpdateParameters {
get { return View.UpdateParameters; }
}
public int Delete (IDictionary keys, IDictionary oldValues)
{
return View.Delete (keys, oldValues);
}
public int Insert (IDictionary values)
{
return View.Insert (values);
}
public int Update (IDictionary keys, IDictionary values, IDictionary oldValues)
{
return View.Update (keys, values, oldValues);
}
#region ViewState
[Category ("Behavior")]
[DefaultValue (true)]
public bool StoreOriginalValuesInViewState {
get { return View.StoreOriginalValuesInViewState; }
set { View.StoreOriginalValuesInViewState = value; }
}
protected override void LoadViewState (object savedState)
{
Pair p = savedState as Pair;
if (p != null) {
base.LoadViewState (p.First);
((IStateManager) View).LoadViewState (p.Second);
}
}
protected override object SaveViewState ()
{
object me = base.SaveViewState (), view = ((IStateManager) View).SaveViewState ();
if (me != null || view != null)
return new Pair (me, view);
else
return null;
}
protected override void TrackViewState ()
{
base.TrackViewState ();
if (view != null)
((IStateManager) view).TrackViewState ();
}
#endregion
#region Events (Dispatching)
public event EventHandler<LinqDataSourceStatusEventArgs> ContextCreated {
add { View.ContextCreated += value; }
remove { View.ContextCreated -= value; }
}
public event EventHandler<LinqDataSourceContextEventArgs> ContextCreating {
add { View.ContextCreating += value; }
remove { View.ContextCreating -= value; }
}
public event EventHandler<LinqDataSourceDisposeEventArgs> ContextDisposing {
add { View.ContextDisposing += value; }
remove { View.ContextDisposing -= value; }
}
public event EventHandler<LinqDataSourceStatusEventArgs> Deleted {
add { View.Deleted += value; }
remove { View.Deleted -= value; }
}
public event EventHandler<LinqDataSourceDeleteEventArgs> Deleting {
add { View.Deleting += value; }
remove { View.Deleting -= value; }
}
event EventHandler<DynamicValidatorEventArgs> IDynamicDataSource.Exception {
add { View.Exception += value; }
remove { View.Exception -= value; }
}
public event EventHandler<LinqDataSourceStatusEventArgs> Inserted {
add { View.Inserted += value; }
remove { View.Inserted -= value; }
}
public event EventHandler<LinqDataSourceInsertEventArgs> Inserting {
add { View.Inserting += value; }
remove { View.Inserting -= value; }
}
public event EventHandler<LinqDataSourceStatusEventArgs> Selected {
add { View.Selected += value; }
remove { View.Selected -= value; }
}
public event EventHandler<LinqDataSourceSelectEventArgs> Selecting {
add { View.Selecting += value; }
remove { View.Selecting -= value; }
}
public event EventHandler<LinqDataSourceStatusEventArgs> Updated {
add { View.Updated += value; }
remove { View.Updated -= value; }
}
public event EventHandler<LinqDataSourceUpdateEventArgs> Updating {
add { View.Updating += value; }
remove { View.Updating -= value; }
}
#endregion
}
}
#endif

View File

@@ -0,0 +1,59 @@
//
// LinqDataSourceContextEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceContextEventArgs : EventArgs
{
public LinqDataSourceContextEventArgs ()
: this (DataSourceOperation.Select)
{
}
public LinqDataSourceContextEventArgs (DataSourceOperation operation)
{
Operation = operation;
}
public object ObjectInstance { get; set; }
public DataSourceOperation Operation { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,60 @@
//
// LinqDataSourceDeleteEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceDeleteEventArgs : CancelEventArgs
{
public LinqDataSourceDeleteEventArgs (object originalObject)
{
OriginalObject = originalObject;
}
public LinqDataSourceDeleteEventArgs (LinqDataSourceValidationException exception)
{
Exception = exception;
}
public LinqDataSourceValidationException Exception { get; private set; }
public bool ExceptionHandled { get; set; }
public object OriginalObject { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,51 @@
//
// LinqDataSourceDisposeEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceDisposeEventArgs : CancelEventArgs
{
public LinqDataSourceDisposeEventArgs (object instance)
{
ObjectInstance = instance;
}
public object ObjectInstance { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,60 @@
//
// LinqDataSourceInsertEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceInsertEventArgs : CancelEventArgs
{
public LinqDataSourceInsertEventArgs (object newObject)
{
NewObject = newObject;
}
public LinqDataSourceInsertEventArgs (LinqDataSourceValidationException exception)
{
Exception = exception;
}
public LinqDataSourceValidationException Exception { get; private set; }
public bool ExceptionHandled { get; set; }
public object NewObject { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,76 @@
//
// LinqDataSourceSelectEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceSelectEventArgs : CancelEventArgs
{
public LinqDataSourceSelectEventArgs (
DataSourceSelectArguments arguments,
IDictionary<string, object> whereParameters,
IOrderedDictionary orderByParameters,
IDictionary<string, object> groupByParameters,
IDictionary<string, object> orderGroupsByParameters,
IDictionary<string, object> selectParameters)
{
// all nullable.
Arguments = arguments;
WhereParameters = whereParameters;
OrderByParameters = orderByParameters;
GroupByParameters = groupByParameters;
OrderGroupsByParameters = orderGroupsByParameters;
SelectParameters = selectParameters;
}
public DataSourceSelectArguments Arguments { get; private set; }
public IDictionary<string, object> GroupByParameters { get; private set; }
public IOrderedDictionary OrderByParameters { get; private set; }
public IDictionary<string, object> OrderGroupsByParameters { get; private set; }
public object Result { get; set; }
public IDictionary<string, object> SelectParameters { get; private set; }
public IDictionary<string, object> WhereParameters { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,69 @@
//
// LinqDataSourceStatusEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceStatusEventArgs : EventArgs
{
public LinqDataSourceStatusEventArgs (Exception exception)
{
Exception = exception;
}
public LinqDataSourceStatusEventArgs (object result)
{
Result = result;
}
public LinqDataSourceStatusEventArgs (object result, int totalRowCount)
{
Result = result;
// no range check
TotalRowCount = totalRowCount;
}
public Exception Exception { get; private set; }
public bool ExceptionHandled { get; set; }
public object Result { get; private set; }
public int TotalRowCount { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,65 @@
//
// LinqDataSourceUpdateEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceUpdateEventArgs : CancelEventArgs
{
public LinqDataSourceUpdateEventArgs (LinqDataSourceValidationException exception)
{
Exception = exception;
}
public LinqDataSourceUpdateEventArgs (object originalObject, object newObject)
{
OriginalObject = originalObject;
NewObject = newObject;
}
public LinqDataSourceValidationException Exception { get; private set; }
public bool ExceptionHandled { get; set; }
public object NewObject { get; private set; }
public object OriginalObject { get; private set; }
}
}
#endif

View File

@@ -0,0 +1,86 @@
//
// LinqDataSourceValidationException.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc http://novell.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
[SerializableAttribute]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LinqDataSourceValidationException : Exception, ISerializable
{
public LinqDataSourceValidationException ()
: this ("LinqDataSource validation error")
{
}
public LinqDataSourceValidationException (string message)
: base (message)
{
}
[MonoTODO]
protected LinqDataSourceValidationException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
throw new NotImplementedException ();
}
public LinqDataSourceValidationException (string message, Exception innerException)
: base (message, innerException)
{
}
public LinqDataSourceValidationException (string message, IDictionary<string, Exception> innerExceptions)
: base (message)
{
if (innerExceptions == null)
throw new ArgumentNullException ("innerExceptions");
InnerExceptions = innerExceptions;
}
[MonoTODO]
[SecurityPermission (SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
throw new NotImplementedException ();
}
public IDictionary<string, Exception> InnerExceptions { get; private set; }
}
}
#endif

File diff suppressed because it is too large Load Diff

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