2 // System.Web.UI.DataSourceSelectArguments.cs
5 // Sanjay Gupta <gsanjay@novell.com>
7 // (C) 2004 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 namespace System
.Web
.UI
36 public sealed class DataSourceSelectArguments
38 string sortExpression
= string.Empty
;
39 int startingRowIndex
= 0;
42 bool getTotalRowCount
= false;
43 int totalRowCount
= -1;
44 DataSourceCapabilities dsc
= DataSourceCapabilities
.None
;
46 public static readonly DataSourceSelectArguments Empty
= new DataSourceSelectArguments ();
48 public DataSourceSelectArguments ()
53 public DataSourceSelectArguments (string sortExpression
)
55 this.sortExpression
= sortExpression
;
59 public DataSourceSelectArguments (int startingRowIndex
, int maxRows
)
61 this.startingRowIndex
= startingRowIndex
;
62 this.maxRows
= maxRows
;
66 public DataSourceSelectArguments (string sortExpression
, int startingRowIndex
, int maxRows
)
68 this.sortExpression
= sortExpression
;
69 this.startingRowIndex
= startingRowIndex
;
70 this.maxRows
= maxRows
;
74 public void AddSupportedCapabilities (DataSourceCapabilities srcCapabilities
)
76 this.dsc
= this.dsc
| srcCapabilities
;
80 public override bool Equals (object obj
)
82 if (!(obj
is DataSourceSelectArguments
))
88 public override int GetHashCode ()
90 return sortExpression
.GetHashCode ();
93 public void RaiseUnsupportedCapabilitiesError (DataSourceView view
)
95 view
.RaiseUnsupportedCapabilityError (this.dsc
);
99 get { return this.isEmpty; }
102 public int MaximumRows
{
103 get { return this.MaximumRows; }
105 this.maxRows
= value;
106 this.isEmpty
= false;
110 public bool RetrieveTotalRowCount
{
111 get { return this.getTotalRowCount; }
112 set { this.getTotalRowCount = value; }
115 public string SortExpression
{
116 get { return this.sortExpression; }
118 this.sortExpression
= value;
119 this.isEmpty
= false;
123 public int StartRowIndex
{
124 get { return this.startingRowIndex; }
126 this.startingRowIndex
= value;
127 this.isEmpty
= false;
131 public int TotalRowCount
{
132 get { return this.totalRowCount; }
134 this.totalRowCount
= value;
135 this.isEmpty
= false;