Beispiel #1
0
        /// <summary>
        /// Adds a new column
        /// </summary>
        /// <param name="expression">Lambda expression that evaluates the property of the POCO you want to import/export with this column</param>
        /// <param name="trueString">This string is used to represent the boolean value 'True'</param>
        /// <param name="falseString">This string is used to represent the boolean value 'False'</param>
        /// <param name="customization">Action that enables additionial customizations of the <see cref="DocumentColumnBuilder{T,TRet}"/></param>
        /// <returns></returns>
        public DocumentFormatDefinitionBuilder <T> AddColumn(Expression <Func <T, bool?> > expression, string trueString, string falseString, Action <DocumentColumnBuilder <T, bool?> > customization = null)
        {
            DocumentColumnBuilder <T, bool?> builder = new DocumentColumnBuilder <T, bool?>(expression).SetBooleanStrings(trueString, falseString);

            if (customization != null)
            {
                customization(builder);
            }

            _columns.Add(builder.Build());

            return(this);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a new column
        /// </summary>
        /// <typeparam name="TRet">The type of the columns data</typeparam>
        /// <param name="expression">Lambda expression that evaluates the property of the POCO you want to import/export with this column</param>
        /// <param name="customization">Action that enables additionial customizations of the <see cref="DocumentColumnBuilder{T,TRet}"/></param>
        /// <returns></returns>
        public DocumentFormatDefinitionBuilder <T> AddColumn <TRet>(Expression <Func <T, TRet> > expression, Action <DocumentColumnBuilder <T, TRet> > customization = null)
        {
            var builder = new DocumentColumnBuilder <T, TRet>(expression);

            if (customization != null)
            {
                customization(builder);
            }

            _columns.Add(builder.Build());

            return(this);
        }
Beispiel #3
0
        /// <summary>
        /// Adds a new column
        /// </summary>
        /// <param name="propertyInfo">The property's PropertyInfo you want to import/export with this column</param>
        /// <param name="stringFormat">String format of the property</param>
        /// <param name="customization">Action that enables additionial customizations of the <see cref="DocumentColumnBuilder{T,TRet}"/></param>
        /// <returns></returns>
        public DocumentFormatDefinitionBuilder <T> AddColumn(PropertyInfo propertyInfo, string stringFormat, Action <DocumentColumnBuilder <T, object> > customization = null)
        {
            DocumentColumnBuilder <T, object> builder = new DocumentColumnBuilder <T, object>(propertyInfo).SetStringFormat(stringFormat);

            if (customization != null)
            {
                customization(builder);
            }

            _columns.Add(builder.Build());

            return(this);
        }