5
// Lluis Sanchez <lluis@xamarin.com>
6
// Eric Maupin <ermau@xamarin.com>
8
// Copyright (c) 2011-2012 Xamarin, Inc.
10
// Permission is hereby granted, free of charge, to any person obtaining a copy
11
// of this software and associated documentation files (the "Software"), to deal
12
// in the Software without restriction, including without limitation the rights
13
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
// copies of the Software, and to permit persons to whom the Software is
15
// furnished to do so, subject to the following conditions:
17
// The above copyright notice and this permission notice shall be included in
18
// all copies or substantial portions of the Software.
20
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
public interface IListDataSource
35
/// Gets the number of rows in the data source.
40
/// Gets the value at the specified <paramref name="row"/> and <paramref name="column"/>.
42
/// <param name="row">The row to retrieve the value from.</param>
43
/// <param name="column">The column to retrieve the value from.</param>
44
/// <returns>A reference to the value.</returns>
45
/// <exception cref="ArgumentOutOfRangeException">
46
/// <para><paramref name="row"/> is >= <see cref="RowCount"/></para>
47
/// <para>-- or --</para>
48
/// <para><paramref name="column"/> is >= the number of columns (<see cref="ColumnTypes"/>).</para>
50
/// <seealso cref="SetValue"/>
51
object GetValue (int row, int column);
54
/// Sets the value at the specified <paramref name="row"/> and <paramref name="column"/>.
56
/// <param name="row">The row to set the value at.</param>
57
/// <param name="column">The column to set the value at.</param>
58
/// <param name="value">The value to set at the given <paramref name="row"/> and <paramref name="column"/>.</param>
59
/// <exception cref="ArgumentOutOfRangeException">
60
/// <para><paramref name="row"/> is >= <see cref="RowCount"/></para>
61
/// <para>-- or --</para>
62
/// <para><paramref name="column"/> is >= the number of columns (<see cref="ColumnTypes"/>).</para>
64
void SetValue (int row, int column, object value);
67
/// Gets the column types of this data source.
69
Type[] ColumnTypes { get; }
72
/// Raised when a row is inserted into the data source.
74
event EventHandler<ListRowEventArgs> RowInserted;
77
/// Raised when a row is deleted from the data source.
79
event EventHandler<ListRowEventArgs> RowDeleted;
82
/// Raised when a column value of a row is changed in the data source.
84
event EventHandler<ListRowEventArgs> RowChanged;
87
/// Raised when rows in the data source is reordered.
89
event EventHandler<ListRowOrderEventArgs> RowsReordered;
92
public class ListRowEventArgs: EventArgs
94
public ListRowEventArgs (int row)
105
public class ListRowOrderEventArgs: ListRowEventArgs
107
public ListRowOrderEventArgs (int parentRow, int[] rows): base (parentRow)
109
ChildrenOrder = rows;
112
public int[] ChildrenOrder {