MethodProperty.cs 641 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Jint.Runtime.Interop;
  3. namespace Jint.Runtime.Descriptors
  4. {
  5. public class MethodProperty : PropertyDescriptor
  6. {
  7. private readonly Delegate _d;
  8. public MethodProperty(Delegate d)
  9. {
  10. _d = d;
  11. }
  12. public override object Get()
  13. {
  14. return new DelegateWrapper(_d, null);
  15. }
  16. public override void Set(object value)
  17. {
  18. }
  19. public override bool IsAccessorDescriptor()
  20. {
  21. return false;
  22. }
  23. public override bool IsDataDescriptor()
  24. {
  25. return false;
  26. }
  27. }
  28. }