Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CategoryAttribute.cs « System.ComponentModel « System « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c68b49cda50bdbcb1aff283f37f06097d7ca5a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//
// System.ComponentModel.CategoryAttribute.cs
//
// Author:
//   Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc.  http://www.ximian.com
//
//

namespace System.ComponentModel {

	[AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
	public class CategoryAttribute : Attribute {
		string category;

		static CategoryAttribute action, appearance, behaviour, data,   def;
		static CategoryAttribute design, drag_drop,  focus,     format, key;
		static CategoryAttribute layout, mouse,      window_style;
		
		public CategoryAttribute (string category)
		{
			this.category = category;
		}

		public CategoryAttribute ()
		{
			this.category = "Misc";
		}

		[MonoTODO]
		protected virtual string GetLocalizedString (string value)
		{
			// FIXME: IMPLEMENT

			return category;
		}

		public string Category {
			get {
				return category;
			}
		}
		
		public static CategoryAttribute Action {
			get {
				if (action != null)
					return action;

				lock (typeof (CategoryAttribute)){
					if (action == null)
						action = new CategoryAttribute ("Action");
				}

				return action;
			}
		}

		public static CategoryAttribute Appearance {
			get {
				if (appearance != null)
					return appearance;

				lock (typeof (CategoryAttribute)){
					if (appearance == null)
						appearance = new CategoryAttribute ("Appearance");
				}

				return appearance;
			}
		}

		public static CategoryAttribute Behaviour {
			get {
				if (behaviour != null)
					return behaviour;

				lock (typeof (CategoryAttribute)){
					if (behaviour == null)
						behaviour = new CategoryAttribute ("Action");
				}

				return behaviour;
			}
		}

		public static CategoryAttribute Data {
			get {
				if (data != null)
					return data;

				lock (typeof (CategoryAttribute)){
					if (data == null)
						data = new CategoryAttribute ("Data");
				}

				return data;
			}
		}

		public static CategoryAttribute Default {
			get {
				if (def != null)
					return def;

				lock (typeof (CategoryAttribute)){
					if (def == null)
						def = new CategoryAttribute ("Default");
				}

				return def;
			}
		}

		public static CategoryAttribute Design {
			get {
				if (design != null)
					return design;

				lock (typeof (CategoryAttribute)){
					if (design == null)
						design = new CategoryAttribute ("Design");
				}

				return design;
			}
		}

		public static CategoryAttribute DragDrop {
			get {
				if (drag_drop != null)
					return drag_drop;

				lock (typeof (CategoryAttribute)){
					if (drag_drop == null)
						drag_drop = new CategoryAttribute ("Drag Drop");
				}

				return drag_drop;
			}
		}

		public static CategoryAttribute Focus {
			get {
				if (focus != null)
					return focus;

				lock (typeof (CategoryAttribute)){
					if (focus == null)
						focus = new CategoryAttribute ("Focus");
				}

				return focus;
			}
		}

		public static CategoryAttribute Format {
			get {
				if (format != null)
					return format;

				lock (typeof (CategoryAttribute)){
					if (format == null)
						format = new CategoryAttribute ("Format");
				}

				return format;
			}
		}

		public static CategoryAttribute Key {
			get {
				if (key != null)
					return key;

				lock (typeof (CategoryAttribute)){
					if (key == null)
						key = new CategoryAttribute ("Key");
				}

				return key;
			}
		}

		public static CategoryAttribute Layout {
			get {
				if (layout != null)
					return layout;

				lock (typeof (CategoryAttribute)){
					if (layout == null)
						layout = new CategoryAttribute ("Layout");
				}

				return layout;
			}
		}

		public static CategoryAttribute Mouse {
			get {
				if (mouse != null)
					return mouse;

				lock (typeof (CategoryAttribute)){
					if (mouse == null)
						mouse = new CategoryAttribute ("Mouse");
				}

				return mouse;
			}
		}

		public static CategoryAttribute WindowStyle {
			get {
				if (window_style != null)
					return window_style;

				lock (typeof (CategoryAttribute)){
					if (window_style == null)
						window_style = new CategoryAttribute ("Window Style");
				}

				return window_style;
			}
		}
	}
}