2
0

PropertyInfo.cs 1.8 KB

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