예제 #1
0
        public CsvOutputFormatter(ITableOrganizer defaultTableOrganizer)
        {
            SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("text/csv"));
            SupportedEncodings.Add(Encoding.UTF8);
            SupportedEncodings.Add(Encoding.Unicode);

            _tableOrganizer = defaultTableOrganizer;
        }
예제 #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);
        }
예제 #3
0
 public void AddOrganizer(Type mappedType, ITableOrganizer tableOrganizer)
 {
     _tableOrganizers.Enqueue(new KeyValuePair <Type, ITableOrganizer>(mappedType, tableOrganizer));
 }
예제 #4
0
 public TableOrganizerNavigator(ITableOrganizer defaultTableOrganizer)
 {
     _defaultTableOrganizer = defaultTableOrganizer;
     _tableOrganizers       = new Queue <KeyValuePair <Type, ITableOrganizer> >();
 }
예제 #5
0
 public EnumerableTableOrganizer(ITableOrganizer itemOrganizer)
 {
     _itemOrganizer = itemOrganizer;
 }