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