Exemplo n.º 1
0
 public PrintingConfig <TOwner> SetAlternateSerialize <TPropType>(Func <TPropType, string> serializer)
 {
     return(new PrintingConfig <TOwner>(this)
     {
         alternateTypeSerializers =
             alternateTypeSerializers.AddOrSet(typeof(TPropType), x => serializer((TPropType)x))
     });
 }
Exemplo n.º 2
0
        public PrintingConfig <TOwner> SetTrimming(
            Expression <Func <TOwner, string> > memberSelector,
            int maxLength)
        {
            var selectedMember = ((MemberExpression)memberSelector.Body).Member;

            return(new PrintingConfig <TOwner>(this)
            {
                memberLengths = memberLengths.AddOrSet(selectedMember, maxLength)
            });
        }
Exemplo n.º 3
0
        public PrintingConfig <TOwner> SetAlternateSerialize <TPropType>(
            Expression <Func <TOwner, TPropType> > memberSelector,
            Func <TPropType, string> alternateSerializer)
        {
            var selectedMember = ((MemberExpression)memberSelector.Body).Member;

            return(new PrintingConfig <TOwner>(this)
            {
                alternateMemberSerializers =
                    alternateMemberSerializers.AddOrSet(selectedMember, x => alternateSerializer((TPropType)x))
            });
        }