Beispiel #1
0
        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;
        }
Beispiel #2
0
 static IEnumerable<object> Map(IEnumerable target, ITotemCallable action)
 {
     return Objectify(target).Select(obj => action.Invoke(obj));
 }
Beispiel #3
0
 static void Each(IEnumerable target, ITotemCallable action)
 {
     foreach (var t in target)
         action.Invoke(t);
 }
Beispiel #4
0
 private void Implement(string name, ITotemCallable callable)
 {
     _customProperties.Add(name, new CustomProperty(
         obj => new TotemMethod(_context, name, callable, obj),
         null
     ));
 }
Beispiel #5
0
 static void Implement(TotemType target, string name, ITotemCallable callable)
 {
     target.Implement(name, callable);
 }
Beispiel #6
0
 internal static TotemMethod Create(TotemContext/*!*/ context, string name, ITotemCallable wrapped, object/*!*/ instance)
 {
     return new TotemMethod(context, name, wrapped, instance);
 }