Esempio n. 1
0
        public static PlainTextFormatter <T> CreateForMembers(params Expression <Func <T, object> >[] members)
        {
            var format = PlainTextFormatter.CreateFormatDelegate <T>(
                typeof(T).GetMembers(members).ToArray());

            return(new PlainTextFormatter <T>(format));
        }
        private static PlainTextFormatter <T> CreateForAllMembers(bool includeInternals = false)
        {
            if (typeof(T).IsScalar())
            {
                return(new PlainTextFormatter <T>((value, writer) => writer.Write(value)));
            }

            return(new PlainTextFormatter <T>(
                       PlainTextFormatter.CreateFormatDelegate <T>(
                           typeof(T).GetAllMembers(includeInternals).ToArray())));
        }
Esempio n. 3
0
 private static PlainTextFormatter <T> CreateForAllMembers(bool includeInternals = false)
 {
     return(new PlainTextFormatter <T>(
                PlainTextFormatter.CreateFormatDelegate <T>(
                    typeof(T).GetAllMembers(includeInternals).ToArray())));
 }