public TotemMethod(TotemContext/*!*/ context, string name, ITotemCallable wrapped, object instance) : base(context.GetType<Types.Method>()) { ContractUtils.RequiresNotNull(wrapped, "wrapped"); ContractUtils.RequiresNotNull(instance, "instance"); _wrapped = wrapped; _name = name; _instance = instance; }
static IEnumerable<object> Map(IEnumerable target, ITotemCallable action) { return Objectify(target).Select(obj => action.Invoke(obj)); }
static void Each(IEnumerable target, ITotemCallable action) { foreach (var t in target) action.Invoke(t); }
private void Implement(string name, ITotemCallable callable) { _customProperties.Add(name, new CustomProperty( obj => new TotemMethod(_context, name, callable, obj), null )); }
static void Implement(TotemType target, string name, ITotemCallable callable) { target.Implement(name, callable); }
internal static TotemMethod Create(TotemContext/*!*/ context, string name, ITotemCallable wrapped, object/*!*/ instance) { return new TotemMethod(context, name, wrapped, instance); }