1
ļ»æ// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
8
//$$ TargetModule (ignored)
9
//[module: CLSCompliantAttribute(false)]
10
//$$ ParameterlessAttributeUsage
11
namespace ParameterLessAttributeUsage
14
public enum EnumWithFlagsAttribute
19
//$$ AttributeWithEnumArgument
20
namespace AttributeWithEnumArgument
22
[AttributeUsage(AttributeTargets.All)]
23
public class MyAttributeAttribute : Attribute
27
//$$ AttributeWithEnumExpressionArgument
28
namespace AttributeWithEnumExpressionArgument
30
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Interface)]
31
public class MyAttributeAttribute : Attribute
35
//$$ AttributeWithStringExpressionArgument
36
namespace AttributeWithStringExpressionArgument
39
public class ObsoletedClass
43
//$$ AttributeWithTypeArgument
44
namespace AttributeWithTypeArgument
46
[AttributeUsage(AttributeTargets.All)]
47
public class MyTypeAttribute : Attribute
49
public MyTypeAttribute(Type t)
54
[MyType(typeof(Attribute))]
55
public class SomeClass
60
namespace AppliedToEvent
62
[AttributeUsage(AttributeTargets.Event)]
63
public class MyAttributeAttribute : Attribute
66
public class TestClass
69
public event EventHandler MyEvent;
73
namespace AppliedToField
75
[AttributeUsage(AttributeTargets.Field)]
76
public class MyAttributeAttribute : Attribute
79
public class TestClass
85
//$$ AppliedToProperty
86
namespace AppliedToProperty
88
public class TestClass
100
//$$ AppliedToPropertyGet
101
namespace AppliedToPropertyGet
103
[AttributeUsage(AttributeTargets.All)]
104
public class MyAttributeAttribute : Attribute
107
public class TestClass
119
//$$ AppliedToPropertySet
120
namespace AppliedToPropertySet
122
[AttributeUsage(AttributeTargets.All)]
123
public class MyAttributeAttribute : Attribute
126
public class TestClass
141
//$$ AppliedToIndexer
142
namespace AppliedToIndexer
144
public class TestClass
147
public int this[int i]
156
//$$ AppliedToDelegate
158
public delegate int AppliedToDelegate();
160
namespace AppliedToMethod
162
[AttributeUsage(AttributeTargets.Method)]
163
public class MyAttributeAttribute : Attribute
166
public class TestClass
174
//$$ AppliedToInterface
176
public interface AppliedToInterface
181
public struct AppliedToStruct
185
//$$ AppliedToParameter
186
namespace AppliedToParameter
188
[AttributeUsage(AttributeTargets.Parameter)]
189
public class MyAttributeAttribute : Attribute
194
public void Method([MyAttribute] int val)
199
//$$ NamedInitializerProperty
200
namespace NamedInitializerProperty
202
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
203
public class MyAttributeAttribute : Attribute
207
//$$ NamedInitializerPropertyString
208
namespace NamedInitializerPropertyString
210
[AttributeUsage(AttributeTargets.All)]
211
public class MyAttributeAttribute : Attribute
224
[MyAttribute(Prop = "value")]
229
//$$ NamedInitializerPropertyType
230
namespace NamedInitializerPropertyType
232
[AttributeUsage(AttributeTargets.All)]
233
public class MyAttributeAttribute : Attribute
246
[MyAttribute(Prop = typeof(Enum))]
251
//$$ NamedInitializerPropertyEnum
252
namespace NamedInitializerPropertyEnum
254
[AttributeUsage(AttributeTargets.All)]
255
public class MyAttributeAttribute : Attribute
257
public AttributeTargets Prop
261
return AttributeTargets.All;
268
[MyAttribute(Prop = (AttributeTargets.Class | AttributeTargets.Method))]
273
//$$ NamedInitializerFieldEnum
274
namespace NamedInitializerFieldEnum
276
[AttributeUsage(AttributeTargets.All)]
277
public class MyAttributeAttribute : Attribute
279
public AttributeTargets Field;
281
[MyAttribute(Field = (AttributeTargets.Class | AttributeTargets.Method))]
287
namespace TargetReturn
289
[AttributeUsage(AttributeTargets.All)]
290
public class MyAttributeAttribute : Attribute
295
[return: MyAttribute]
296
public int MyMethod()
302
//$$ TargetPropertyGetReturn
303
namespace TargetPropertyGetReturn
305
[AttributeUsage(AttributeTargets.All)]
306
public class MyAttributeAttribute : Attribute
313
[return: MyAttribute]
321
//$$ TargetPropertySetParam
322
namespace TargetPropertySetParam
324
[AttributeUsage(AttributeTargets.All)]
325
public class MyAttributeAttribute : Attribute
339
//$$ TargetPropertySetReturn
340
namespace TargetPropertySetReturn
342
[AttributeUsage(AttributeTargets.All)]
343
public class MyAttributeAttribute : Attribute
354
[return: MyAttribute]
361
//$$ TargetPropertyIndexGetReturn
362
namespace TargetPropertyIndexGetReturn
364
[AttributeUsage(AttributeTargets.All)]
365
public class MyAttributeAttribute : Attribute
370
public int this[string s]
372
[return: MyAttribute]
380
//$$ TargetPropertyIndexParamOnlySet
381
namespace TargetPropertyIndexParamOnlySet
383
[AttributeUsage(AttributeTargets.All)]
384
public class MyAttributeAttribute : Attribute
389
public int this[[MyAttribute] string s]
397
//$$ TargetPropertyIndexParamOnlyGet
398
namespace TargetPropertyIndexParamOnlyGet
400
[AttributeUsage(AttributeTargets.All)]
401
public class MyAttributeAttribute : Attribute
406
public int this[[MyAttribute] string s]
415
//$$ TargetPropertyIndexSetReturn
416
namespace TargetPropertyIndexSetReturn
418
[AttributeUsage(AttributeTargets.All)]
419
public class MyAttributeAttribute : Attribute
424
public string this[int index]
430
[return: MyAttribute]
437
//$$ TargetPropertyIndexSetMultiParam
438
namespace TargetPropertyIndexSetMultiParam
440
[AttributeUsage(AttributeTargets.All)]
441
public class MyAttributeAttribute : Attribute
447
public string this[[MyAttribute(Field = 2)] int index1, [MyAttribute(Field = 3)] int index2]
460
//$$ ClassAttributeOnTypeParameter
461
namespace ClassAttributeOnTypeParameter
463
[AttributeUsage(AttributeTargets.All)]
464
public class MyAttributeAttribute : Attribute
467
public class MyClass<[MyAttribute] T>
471
//$$ AttributeOnReturnTypeOfDelegate
472
namespace AttributeOnReturnTypeOfDelegate
474
[AttributeUsage(AttributeTargets.All)]
475
public class MyAttributeAttribute : Attribute
478
[return: MyAttribute]
479
public delegate void Test();