PropertyBuilder

PropertyBuilder

System.Reflection.Emit (mscorlib.dll) sealed class

This class represents a dynamically created property. To create a PropertyBuilder object, use the TypeBuilder.DefineProperty( ) method and specify the parameter types, return value type, and any additional special settings through the System.Reflection.PropertyAttributes enumeration. You can specify MethodBuilder objects for the property get and property set methods using SetGetMethod( ) and SetSetMethod( ) . You can also set the property's default value using the SetConstant( ) method.

 public sealed class  PropertyBuilder  : System.Reflection.PropertyInfo {  // Public Instance Properties  public override PropertyAttributes  Attributes  {get; }  // overrides System.Reflection.PropertyInfo  public override bool  CanRead  {get; }  // overrides System.Reflection.PropertyInfo  public override bool  CanWrite  {get; }  // overrides System.Reflection.PropertyInfo  public override Type  DeclaringType  {get; }  // overrides System.Reflection.MemberInfo  public override string  Name  {get; }  // overrides System.Reflection.MemberInfo  public PropertyToken  PropertyToken  {get; }    public override Type  PropertyType  {get; }  // overrides System.Reflection.PropertyInfo  public override Type  ReflectedType  {get; }  // overrides System.Reflection.MemberInfo   // Public Instance Methods  public void  AddOtherMethod  (MethodBuilder   mdBuilder   );    public override MethodInfo[ ]  GetAccessors  (bool   nonPublic   );  // overrides System.Reflection.PropertyInfo  public override object[ ]  GetCustomAttributes  (bool   inherit   )  // overrides System.Reflection.MemberInfo  public override object[ ]  GetCustomAttributes  (Type   attributeType   , bool   inherit   )  // overrides System.Reflection.MemberInfo  public override MethodInfo  GetGetMethod  (bool   nonPublic   );  // overrides System.Reflection.PropertyInfo  public override ParameterInfo[ ]  GetIndexParameters  ( );  // overrides System.Reflection.PropertyInfo  public override MethodInfo  GetSetMethod  (bool   nonPublic   );  // overrides System.Reflection.PropertyInfo  public override object  GetValue  (object   obj   , System.Reflection.BindingFlags   invokeAttr   ,         System.Reflection.Binder   binder   ,        object[ ]   index   , System.Globalization.CultureInfo   culture   );  // overrides System.Reflection.PropertyInfo  public override object  GetValue  (object   obj   , object[ ]   index   );  // overrides System.Reflection.PropertyInfo  public override bool  IsDefined  (Type   attributeType   ,bool   inherit   )  // overrides System.Reflection.MemberInfo  public void  SetConstant  (object   defaultValue   );    public void  SetCustomAttribute  (System.Reflection.ConstructorInfo   con   , byte[ ]   binaryAttribute   );    public void  SetCustomAttribute  (CustomAttributeBuilder   customBuilder   );    public void  SetGetMethod  (MethodBuilder   mdBuilder   );    public void  SetSetMethod  (MethodBuilder   mdBuilder   );    public override void  SetValue  (object   obj   , object   value   , System.Reflection.BindingFlags   invokeAttr   ,         System.Reflection.Binder   binder   , object[ ]   index   , System.Globalization.CultureInfo   culture   );  // overrides System.Reflection.PropertyInfo  public override void  SetValue  (object   obj   , object   value   , object[ ]   index   );  // overrides System.Reflection.PropertyInfo  } 

Hierarchy

System.Object System.Reflection.MemberInfo(System.Reflection.ICustomAttributeProvider) System.Reflection.PropertyInfo PropertyBuilder

Returned By

TypeBuilder.DefineProperty( )



C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net