ArrayFactoryBehavior.cs 729 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ClaySharp.Behaviors {
  6. public class ArrayFactoryBehavior : ClayBehavior {
  7. public override object InvokeMember(Func<object> proceed, object self, string name, INamedEnumerable<object> args) {
  8. if (name == "Array") {
  9. dynamic x = new Clay(
  10. new InterfaceProxyBehavior(),
  11. new PropBehavior(),
  12. new ArrayPropAssignmentBehavior(),
  13. new ArrayBehavior(),
  14. new NilResultBehavior());
  15. x.AddRange(args);
  16. return x;
  17. }
  18. return proceed();
  19. }
  20. }
  21. }