| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
Model\AttributeModel\XAttr.cs | - | 0,0 % | 0,0 % | 0,0 % |
|
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 | using System.Collections; | |
26 | ||
27 | namespace ShowX.Model.AttributeModel | |
28 | { | |
29 | /// <summary> | |
30 | /// Represents an attribute of the business object. | |
31 | /// </summary> | |
32 | /// <remarks> | |
33 | /// Properties that represents editable values should be marked as XAttr. This | |
34 | /// allow recognition of this kind of elements if we are working with the attribute | |
35 | /// mapping model. | |
36 | /// </remarks> | |
37 | [AttributeUsage(AttributeTargets.Property)] | |
38 | public class XAttr : Attribute, IPropertyMap | |
39 | { | |
40 | /// <summary> | |
41 | /// Name of the attribute. Default value is "". | |
42 | /// </summary> | |
43 | protected string name =""; | |
44 | ||
45 | /// <summary> | |
46 | /// Heading to show over this property. | |
47 | /// </summary> | |
48 | protected string heading = ""; | |
49 | ||
50 | /// <summary> | |
51 | /// Is this attribute read only?. If true, it won't be editable on editing over | |
52 | /// this class. Default value is false. | |
53 | /// </summary> | |
54 | protected bool readOnly = false; | |
55 | ||
56 | /// <summary> | |
57 | /// Is this attribute show? If false, the attribute won't be show neither on | |
58 | /// editing or viewing. Default value is true. | |
59 | /// </summary> | |
60 | protected bool show = true; | |
61 | ||
62 | /// <summary> | |
63 | /// Is this attribute editable when we are inserting a new instance? | |
64 | /// Default value is true. | |
65 | /// </summary> | |
66 | protected bool editOnInsert = true; | |
67 | ||
68 | /// <summary> | |
69 | /// Is this attribute a password?. Default value is false. | |
70 | /// </summary> | |
71 | protected bool isPassword = false; | |
72 | ||
73 | /// <summary> | |
74 | /// Validators associated to this attribute. | |
75 | /// </summary> | |
76 | protected ArrayList validators = new ArrayList(); | |
77 | ||
78 | /// <summary> | |
79 | /// Style of this item. | |
80 | /// </summary> | |
81 | protected ItemStyle itemStyle; | |
82 | ||
83 | /// <summary> | |
84 | /// Translator for this item. | |
85 | /// </summary> | |
86 | protected ITranslator translator; | |
87 | ||
88 | /// <summary> | |
89 | /// Reflex the <see cref="name"/> field. | |
90 | /// </summary> | |
91 | 0 | public string Name |
92 | { | |
93 | get { return name; } | |
94 | set { this.name = value; } | |
95 | } | |
96 | ||
97 | /// <summary> | |
98 | /// Reflex the <see cref="readOnly"/> field. | |
99 | /// </summary> | |
100 | 0 | public virtual bool ReadOnly |
101 | { | |
102 | get { return readOnly; } | |
103 | set { this.readOnly = value; } | |
104 | } | |
105 | ||
106 | /// <summary> | |
107 | /// Reflex the <see cref="editOnInsert"/> field. | |
108 | /// </summary> | |
109 | 0 | public virtual bool EditOnInsert |
110 | { | |
111 | get { return editOnInsert; } | |
112 | set { this.editOnInsert = value; } | |
113 | } | |
114 | ||
115 | /// <summary> | |
116 | /// Reflex the <see cref="isPassword"/> field. | |
117 | /// </summary> | |
118 | 0 | public virtual bool IsPassword |
119 | { | |
120 | get { return isPassword; } | |
121 | set { this.isPassword = value; } | |
122 | } | |
123 | ||
124 | /// <summary> | |
125 | /// Reflex the <see cref="show"/> field. | |
126 | /// </summary> | |
127 | 0 | public bool Show |
128 | { | |
129 | get { return show; } | |
130 | set { this.show = value; } | |
131 | } | |
132 | ||
133 | /// <summary> | |
134 | /// Reflex the <see cref="itemStyle"/> field. | |
135 | /// </summary> | |
136 | 0 | public ItemStyle ItemStyle |
137 | { | |
138 | get { return this.itemStyle; } | |
139 | set { this.itemStyle = value; } | |
140 | } | |
141 | ||
142 | /// <summary> | |
143 | /// Reflex the <see cref="translator"/> field. | |
144 | /// </summary> | |
145 | 0 | public ITranslator Translator |
146 | { | |
147 | get { return this.translator; } | |
148 | set { this.translator = value; } | |
149 | } | |
150 | ||
151 | /// <summary> | |
152 | /// Reflex the <see cref="heading"/> field. | |
153 | /// </summary> | |
154 | 0 | public string Heading |
155 | { | |
156 | get { return this.heading; } | |
157 | set { this.heading = value; } | |
158 | } | |
159 | } | |
160 | } |
|