PropertyInfo.cs 1.7 KB

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