2004-01-04 Nick Drochak <ndrochak@gol.com>
[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.Reflection;
12 using System.Globalization;
13 using System.Runtime.InteropServices;
14
15 namespace System.Reflection {
16         [Serializable]
17         [ClassInterface(ClassInterfaceType.AutoDual)]
18         public abstract class PropertyInfo : MemberInfo {
19
20                 public abstract PropertyAttributes Attributes { get; }
21                 public abstract bool CanRead { get; }
22                 public abstract bool CanWrite { get; }
23
24                 public bool IsSpecialName {
25                         get {return (Attributes & PropertyAttributes.SpecialName) != 0;}
26                 }
27
28                 public override MemberTypes MemberType {
29                         get {return MemberTypes.Property;}
30                 }
31                 public abstract Type PropertyType { get; }
32         
33                 protected PropertyInfo () { }
34
35                 public MethodInfo[] GetAccessors ()
36                 {
37                         return GetAccessors (false);
38                 }
39                 
40                 public abstract MethodInfo[] GetAccessors (bool nonPublic);
41
42                 public MethodInfo GetGetMethod()
43                 {
44                         return GetGetMethod (false);
45                 }
46                 public abstract MethodInfo GetGetMethod(bool nonPublic);
47                 
48                 public abstract ParameterInfo[] GetIndexParameters();
49
50                 public MethodInfo GetSetMethod()
51                 {
52                         return GetSetMethod (false);
53                 }
54                 
55                 public abstract MethodInfo GetSetMethod (bool nonPublic);
56                 
57                 public virtual object GetValue (object obj, object[] index)
58                 {
59                         return GetValue(obj, BindingFlags.Default, null, index, null);
60                 }
61                 
62                 public abstract object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
63                 
64                 public virtual void SetValue (object obj, object value, object[] index)
65                 {
66                         SetValue (obj, value, BindingFlags.Default, null, index, null);
67                 }
68                 
69                 public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
70         }
71 }