public FileProvider(
            TabularFileAdapterFactory fileAdapterFactory,
            IMonitor monitor,
            IReadOnlyCollection <string> attributeNames)
        {
            if (null == fileAdapterFactory)
            {
                throw new ArgumentNullException(nameof(fileAdapterFactory));
            }

            if (null == monitor)
            {
                throw new ArgumentNullException(nameof(monitor));
            }

            this.Monitor = monitor;

            Type typeAttributeNames             = typeof(AttributeNames);
            IReadOnlyCollection <string> buffer =
                typeAttributeNames.GetFields(BindingFlags.Public | BindingFlags.Static)
                .Select(
                    (FieldInfo item) =>
                    (string)item.GetValue(null))
                .ToArray();

            this.ColumnNames =
                buffer
                .Union(attributeNames)
                .Distinct()
                .ToArray();

            this.file = fileAdapterFactory.CreateFileAdapter(this.ColumnNames);
        }
Esempio n. 2
0
        protected FileProviderFactory(
            TabularFileAdapterFactory fileAdapterFactory,
            IMonitor monitoringBehavior,
            IReadOnlyCollection <string> attributeNames)
        {
            if (null == fileAdapterFactory)
            {
                throw new ArgumentNullException(nameof(fileAdapterFactory));
            }

            if (null == monitoringBehavior)
            {
                throw new ArgumentNullException(nameof(monitoringBehavior));
            }

            if (null == attributeNames)
            {
                throw new ArgumentNullException(nameof(attributeNames));
            }

            this.FileAdapterFactory = fileAdapterFactory;
            this.MonitoringBehavior = monitoringBehavior;
            this.AttributeNames     = attributeNames;
        }
 public FileProvider(
     TabularFileAdapterFactory fileAdapterFactory,
     IMonitor monitor)
     : this(fileAdapterFactory, monitor, new string[0])
 {
 }
Esempio n. 4
0
 protected FileProviderFactory(
     TabularFileAdapterFactory fileAdapterFactory,
     IMonitor monitoringBehavior)
     : this(fileAdapterFactory, monitoringBehavior, new string[0])
 {
 }