Ejemplo n.º 1
0
        public TotemArgs(TotemContext context, string[] names, IList<object> args, Dictionary<string, object> kwargs)
            : base(context.GetType<Types.Arguments>())
        {
            _names = new ReadOnlyCollectionBuilder<string>(names).ToReadOnlyCollection();
            var vb = new ReadOnlyCollectionBuilder<object>();
            var nvb = new Dictionary<string, object>();
            var snb = new ReadOnlyCollectionBuilder<string>();

            for (var i = 0; i < args.Count; i++)
            {
                vb.Add(args[i]);
                if (i < names.Length)
                    nvb.Add(names[i], args[i]);
            }

            foreach (var arg in kwargs)
            {
                nvb.Add(arg.Key, arg.Value);
                snb.Add(arg.Key);
            }

            _values = vb.ToReadOnlyCollection();
            _namedValues = new ReadOnlyDictionary<string, object>(nvb);
            _named = snb.ToReadOnlyCollection();
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
0
 private TotemNull(TotemContext context)
     : base(context.GetType<Null>())
 {
 }
Ejemplo n.º 4
0
        internal TotemOverload(TotemContext context, TotemType type, string name, Tuple<MethodInfo, TotemType.DynamicFlags>/*!*/[]/*!*/ methodInfos)
            : base(context.GetType<Overloaded>())
        {
            ContractUtils.RequiresNotNull(methodInfos, "methodInfos");
            ContractUtils.RequiresNotNull(name, "name");
            ContractUtils.RequiresNotNull(type, "type");

            _methodInfos = methodInfos;
            _name = name;
            _typeDefinition = type;
        }