Exemplo n.º 1
0
 public void CopyFrom(AbcParameterList list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     foreach (var p in list)
     {
         Add(new AbcParameter(p.Type, p.Name));
     }
 }
Exemplo n.º 2
0
        public void AddParameters(AbcParameterList list, params object[] args)
        {
            if (args == null)
            {
                return;
            }
            int n = args.Length;

            for (int i = 0; i < n; ++i)
            {
                var arg = args[i];

                var p = arg as AbcParameter;
                if (p != null)
                {
                    list.Add(ImportParam(p));
                    continue;
                }

                var typeName = DefineTypeName(arg);
                if (typeName != null)
                {
                    var name = GetParamName(args, ref i);
                    list.Add(new AbcParameter(typeName, name));
                    continue;
                }

                var m = arg as AbcMethod;
                if (m != null)
                {
                    list.CopyFrom(m);
                    continue;
                }

                var pl = arg as AbcParameterList;
                if (pl != null)
                {
                    list.CopyFrom(pl);
                    continue;
                }

                throw new NotImplementedException();
            }
        }