Exemplo n.º 1
0
        public CsvOutputFormatter(ITableOrganizer defaultTableOrganizer)
        {
            SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("text/csv"));
            SupportedEncodings.Add(Encoding.UTF8);
            SupportedEncodings.Add(Encoding.Unicode);

            _tableOrganizer = defaultTableOrganizer;
        }
Exemplo n.º 2
0
        private ITableOrganizer FindMatchTableOrganizer(Type type)
        {
            ITableOrganizer selectedOrganizer = null;

            foreach (var organizer in _tableOrganizers)
            {
                if (organizer.Key.IsAssignableFrom(type))
                {
                    selectedOrganizer = organizer.Value;
                    break;
                }
            }

            if (selectedOrganizer == null)
            {
                selectedOrganizer = _defaultTableOrganizer;
            }

            return(selectedOrganizer);
        }
Exemplo n.º 3
0
 public void AddOrganizer(Type mappedType, ITableOrganizer tableOrganizer)
 {
     _tableOrganizers.Enqueue(new KeyValuePair <Type, ITableOrganizer>(mappedType, tableOrganizer));
 }
Exemplo n.º 4
0
 public TableOrganizerNavigator(ITableOrganizer defaultTableOrganizer)
 {
     _defaultTableOrganizer = defaultTableOrganizer;
     _tableOrganizers       = new Queue <KeyValuePair <Type, ITableOrganizer> >();
 }
Exemplo n.º 5
0
 public EnumerableTableOrganizer(ITableOrganizer itemOrganizer)
 {
     _itemOrganizer = itemOrganizer;
 }