2272b53a9bda48b0866548d0e9c6a6fc20bfd9ca
[mono.git] / mcs / class / corlib / System.Reflection / PropertyInfo.cs
1 //
2 // System.Reflection/PropertyInfo.cs
3 //
4 // Author:
5 //   Paolo Molaro (lupus@ximian.com)
6 //
7 // (C) 2001 Ximian, Inc.  http://www.ximian.com
8 //
9
10 using System;
11 using System.Diagnostics;
12 using System.Reflection;
13 using System.Globalization;
14 using System.Runtime.InteropServices;
15
16 namespace System.Reflection {
17         [Serializable]
18         [ClassInterface(ClassInterfaceType.AutoDual)]
19         public abstract class PropertyInfo : MemberInfo {
20
21                 public abstract PropertyAttributes Attributes { get; }
22                 public abstract bool CanRead { get; }
23                 public abstract bool CanWrite { get; }
24
25                 public bool IsSpecialName {
26                         get {return (Attributes & PropertyAttributes.SpecialName) != 0;}
27                 }
28
29                 public override MemberTypes MemberType {
30                         get {return MemberTypes.Property;}
31                 }
32                 public abstract Type PropertyType { get; }
33         
34                 protected PropertyInfo () { }
35
36                 public MethodInfo[] GetAccessors ()
37                 {
38                         return GetAccessors (false);
39                 }
40                 
41                 public abstract MethodInfo[] GetAccessors (bool nonPublic);
42
43                 public MethodInfo GetGetMethod()
44                 {
45                         return GetGetMethod (false);
46                 }
47                 public abstract MethodInfo GetGetMethod(bool nonPublic);
48                 
49                 public abstract ParameterInfo[] GetIndexParameters();
50
51                 public MethodInfo GetSetMethod()
52                 {
53                         return GetSetMethod (false);
54                 }
55                 
56                 public abstract MethodInfo GetSetMethod (bool nonPublic);
57                 
58                 [DebuggerHidden]
59                 [DebuggerStepThrough]
60                 public virtual object GetValue (object obj, object[] index)
61                 {
62                         return GetValue(obj, BindingFlags.Default, null, index, null);
63                 }
64                 
65                 public abstract object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
66                 
67                 [DebuggerHidden]
68                 [DebuggerStepThrough]
69                 public virtual void SetValue (object obj, object value, object[] index)
70                 {
71                         SetValue (obj, value, BindingFlags.Default, null, index, null);
72                 }
73                 
74                 public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
75         }
76 }