| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Model\IObjectHandler.cs | - | - | - | - |
|
1 | #region Copyright | |
2 | /* | |
3 | ShowX. Maps business objects into presentation layer. | |
4 | Copyright (C) 2005 Jesus Diaz. | |
5 | ||
6 | This library is free software; you can redistribute it and/or | |
7 | modify it under the terms of the GNU Lesser General Public | |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
10 | ||
11 | This library is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | Lesser General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU Lesser General Public | |
17 | License along with this library; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
19 | ||
20 | For project details see: http://showx.sourceforge.net | |
21 | */ | |
22 | #endregion | |
23 | ||
24 | using System.Collections; | |
25 | ||
26 | namespace ShowX.Model | |
27 | { | |
28 | /// <summary> | |
29 | /// IObjectHandler brings a common interface to handle instance operations needed | |
30 | /// by showX controls, such as list all the elements of a certain type, add a new | |
31 | /// element, and more. | |
32 | /// </summary> | |
33 | public interface IObjectHandler | |
34 | { | |
35 | /// <summary> | |
36 | /// Add a type instance. | |
37 | /// </summary> | |
38 | /// <param name="context">Context in wich occurs the operation.</param> | |
39 | /// <param name="parameters">Array of parameters needed to add the instance to | |
40 | /// the system. | |
41 | /// </param> | |
42 | object AddX(object context, object[] parameters); | |
43 | ||
44 | /// <summary> | |
45 | /// Update a class intance, given an array of parameters with the | |
46 | /// new information. | |
47 | /// </summary> | |
48 | /// <param name="context">Context in wich occurs the operation.</param> | |
49 | /// <param name="parameters">An array of objects, with all the information | |
50 | /// needed to update the instance</param> | |
51 | /// <remarks>The first value of the array must be the identifier of the | |
52 | /// object to update.</remarks> | |
53 | void UpdateX (object context, params object[] parameters); | |
54 | ||
55 | /// <summary> | |
56 | /// Create a new instance of a certain class. | |
57 | /// </summary> | |
58 | /// <returns>An instance of class.</returns> | |
59 | object NewX(); | |
60 | ||
61 | /// <summary> | |
62 | /// Delete a certain insance | |
63 | /// </summary> | |
64 | /// <param name="context">Context in wich occurs the operation.</param> | |
65 | /// <param name="id">Identifier of the intance to delete.</param> | |
66 | void DelXByID (object context, int id); | |
67 | ||
68 | /// <summary> | |
69 | /// Get a certain instance, given its identifier. | |
70 | /// </summary> | |
71 | /// <param name="context">Context in wich occurs the operation.</param> | |
72 | /// <param name="id">Identifier of the searched instance.</param> | |
73 | /// <returns>The searched instance subclass, or null if there's no object | |
74 | /// associated to the given identifier.</returns> | |
75 | object GetXByID(object context, int id); | |
76 | ||
77 | /// <summary> | |
78 | /// Get all objects of a certain type. | |
79 | /// </summary> | |
80 | /// <param name="context">Context in wich occurs the operation.</param> | |
81 | /// <returns>An arraylist of objects subclasses. | |
82 | /// </returns> | |
83 | ArrayList GetAllX(object context); | |
84 | } | |
85 | } | |
86 |
|