Esempio n. 1
0
    public static ReadOnlyList <T> Create <T>(params IEnumerable <T>[] sequences)
    {
        var list = new G.List <T>();

        sequences.Where(s => s != null).Iterate(s => list.AddRange(s));
        return(new ReadOnlyList <T>(list));
    }
Esempio n. 2
0
        void Traversed(ConstantExpression X)
        {
            //If selections have already been specified, ignore
            if (selections.Count != 0)
            {
                return;
            }

            if (not(X.Type.IsGenericType))
            {
                return;
            }

            if (X.Type.GetGenericTypeDefinition() != typeof(ModelSpecifier <,>))
            {
                return;
            }

            var subject = X.Type.GetGenericArguments()[1];
            var members = subject.GetProperties().Cast <MemberInfo>().Union(subject.GetFields());

            selections.AddRange(mapi(members, (i, m) => new SelectedMember(m, i)));
        }