b72596fbedc8abfd51331a6dd741088d852c4548
[mono.git] / mcs / class / corlib / System.Reflection.Emit / PropertyBuilder.cs
1
2 //
3 // System.Reflection.Emit/PropertyBuilder.cs
4 //
5 // Author:
6 //   Paolo Molaro (lupus@ximian.com)
7 //
8 // (C) 2001 Ximian, Inc.  http://www.ximian.com
9 //
10
11 using System;
12 using System.Reflection;
13 using System.Reflection.Emit;
14 using System.Globalization;
15 using System.Runtime.CompilerServices;
16
17 namespace System.Reflection.Emit {
18         public sealed class PropertyBuilder : PropertyInfo {
19                 private PropertyAttributes attrs;
20                 private string name;
21                 private Type type;
22                 private Type[] parameters;
23                 private object def_value;
24                 private MethodBuilder set_method;
25                 private MethodBuilder get_method;
26                 private int table_idx = 0;
27                 internal TypeBuilder typeb;
28                 
29                 internal PropertyBuilder (TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
30                         this.name = name;
31                         this.attrs = attributes;
32                         this.type = returnType;
33                         if (parameterTypes != null) {
34                                 this.parameters = new Type [parameterTypes.Length];
35                                 System.Array.Copy (parameterTypes, this.parameters, this.parameters.Length);
36                         }
37                         typeb = tb;
38                         table_idx = tb.get_next_table_index (0x17, true);
39                 }
40
41                 public override PropertyAttributes Attributes {
42                         get {return attrs;}
43                 }
44                 public override bool CanRead {
45                         get {return get_method != null;}
46                 }
47                 public override bool CanWrite {
48                         get {return set_method != null;}
49                 }
50                 public override Type DeclaringType {
51                         get {return null;}
52                 }
53                 public override string Name {
54                         get {return name;}
55                 }
56                 public PropertyToken PropertyToken {
57                         get {return new PropertyToken ();}
58                 }
59                 public override Type PropertyType {
60                         get {return type;}
61                 }
62                 public override Type ReflectedType {
63                         get {return null;}
64                 }
65                 public void AddOtherMethod( MethodBuilder mdBuilder) {
66                 }
67                 public override MethodInfo[] GetAccessors( bool nonPublic) {
68                         return null;
69                 }
70                 public override object[] GetCustomAttributes(bool inherit) {
71                         return null;
72                 }
73                 public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
74                         return null;
75                 }
76                 public override MethodInfo GetGetMethod( bool nonPublic) {
77                         return get_method;
78                 }
79                 public override ParameterInfo[] GetIndexParameters() {
80                         return null;
81                 }
82                 public override MethodInfo GetSetMethod( bool nonPublic) {
83                         return set_method;
84                 }
85                 public override object GetValue(object obj, object[] index) {
86                         return null;
87                 }
88                 public override object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
89                         return null;
90                 }
91                 public override bool IsDefined( Type attributeType, bool inherit) {
92                         return false;
93                 }
94                 public void SetConstant( object defaultValue) {
95                         def_value = defaultValue;
96                 }
97                 public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
98                 }
99                 public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
100                 }
101                 public void SetGetMethod( MethodBuilder mdBuilder) {
102                         get_method = mdBuilder;
103                 }
104                 public void SetSetMethod( MethodBuilder mdBuilder) {
105                         set_method = mdBuilder;
106                 }
107                 public override void SetValue( object obj, object value, object[] index) {
108                 }
109                 public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
110                 }
111         }
112 }
113