Beispiel #1
0
        public IExcelOperater Format <T>(Expression <Func <T, object> > expression, IColumnFormatter formatter)
        {
            if (expression == null)
            {
                throw new ArgumentException(nameof(expression));
            }
            if (formatter == null)
            {
                throw new ArgumentException(nameof(formatter));
            }
            PropertyInfo propertyInfo = ExpressionParser.ParserProperty(expression);

            if (!_formatMap.ContainsKey(propertyInfo))
            {
                _formatMap.Add(propertyInfo, formatter);
            }

            return(this);
        }
Beispiel #2
0
        public void Register(string columnName, IColumnFormatter formatter)
        {
            var key = BuildKeyForColumn(columnName);

            _formatters[key] = formatter;
        }
Beispiel #3
0
        public void Register(string tableName, string columnName, IColumnFormatter formatter)
        {
            var key = BuildKeyForTableAndColumn(tableName, columnName);

            _formatters[key] = formatter;
        }
Beispiel #4
0
        public void Register(Type type, IColumnFormatter formatter)
        {
            var key = BuildKeyForType(type);

            _formatters[key] = formatter;
        }
 public DateTimeFormatAttribute(string formatString)
 {
     formatter = new DateTimeFormatter(formatString);
 }
Beispiel #6
0
 public IDbSafeManager RegisterFormatter(string columnName, IColumnFormatter formatter)
 {
     _formatterManager.Register(columnName, formatter);
     return(this);
 }
Beispiel #7
0
 public IDbSafeManager RegisterFormatter(Type type, IColumnFormatter formatter)
 {
     _formatterManager.Register(type, formatter);
     return(this);
 }