| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Model\IValidationMap.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; | |
25 | ||
26 | namespace ShowX.Model | |
27 | { | |
28 | /// <summary> | |
29 | /// Define the type that should conform any validation map. | |
30 | /// </summary> | |
31 | public interface IValidationMap | |
32 | { | |
33 | /// <summary> | |
34 | /// ValidateFor define the kind of validation defined over this map. | |
35 | /// </summary> | |
36 | ValidateFor ValidateFor | |
37 | { | |
38 | get; | |
39 | set; | |
40 | } | |
41 | ||
42 | /// <summary> | |
43 | /// Message to show in case validation was unsucessful. | |
44 | /// </summary> | |
45 | string Message | |
46 | { | |
47 | get; | |
48 | set; | |
49 | } | |
50 | ||
51 | /// <summary> | |
52 | /// Regular expression to match on validation. | |
53 | /// </summary> | |
54 | string RegularExpression | |
55 | { | |
56 | get; | |
57 | set; | |
58 | } | |
59 | ||
60 | /// <summary> | |
61 | /// Type in wich this validation is attached. | |
62 | /// </summary> | |
63 | Type Type | |
64 | { | |
65 | get; | |
66 | set; | |
67 | } | |
68 | ||
69 | /// <summary> | |
70 | /// Name of the property in wich this validation is attached. | |
71 | /// </summary> | |
72 | string PropertyName | |
73 | { | |
74 | get; | |
75 | set; | |
76 | } | |
77 | ||
78 | /// <summary> | |
79 | /// Validate the input value, over the kind of validation defined here. The | |
80 | /// value is input as a string. | |
81 | /// </summary> | |
82 | /// <param name="context">Context in which occurs the operation (supplied by | |
83 | /// user via control properties)</param> | |
84 | /// <param name="s">Value to validate.</param> | |
85 | /// <returns>True if the value fulfills the requeriments of this validator. | |
86 | /// False otherwise.</returns> | |
87 | bool Validate(object context, string s); | |
88 | } | |
89 | } | |
90 |
|