public DbReaderEx(string id, IOptionsSet options) : base(new DbReaderOptions(options)) { _connection = new OleDbConnection(Options.ConnectionString); _id = id; _dataset = null; }
public KafkaTopicReceiveEndpointConfiguration(IKafkaHostConfiguration hostConfiguration, ConsumerConfig consumerConfig, string topic, IBusInstance busInstance, IReceiveEndpointConfiguration endpointConfiguration, IHeadersDeserializer headersDeserializer) : base(endpointConfiguration) { _hostConfiguration = hostConfiguration; _busInstance = busInstance; _endpointConfiguration = endpointConfiguration; _consumerConfig = consumerConfig; _options = new OptionsSet(); Topic = topic; if (!SerializationUtils.DeSerializers.IsDefaultKeyType <TKey>()) { SetKeyDeserializer(new MassTransitJsonDeserializer <TKey>()); } SetValueDeserializer(new MassTransitJsonDeserializer <TValue>()); SetHeadersDeserializer(headersDeserializer); CheckpointInterval = TimeSpan.FromMinutes(1); CheckpointMessageCount = 5000; MessageLimit = 10000; ConcurrencyLimit = 1; _consumerConfigurator = new PipeConfigurator <ConsumerContext <TKey, TValue> >(); }
public OptionsSet(IOptionsSet other) { _readonly = false; OptionsSet otherOS = other as OptionsSet; if (otherOS != null) { _options = new Dictionary <string, object>(otherOS._options); } else { foreach (var pair in other.All()) { _options.Add(pair); } } }
public IFormatReader <IFileOptionsSet> CreateReaderByExtension(string path, IOptionsSet baseOptions = null) { var extToTypeMap = new Dictionary <string, ReaderType>() { { ".xls", ReaderType.Excel }, { ".xlm", ReaderType.Excel }, { ".xlsx", ReaderType.Excel2007 }, { ".xlsm", ReaderType.Excel2007 }, { ".dbf", ReaderType.Dbf }, { ".csv", ReaderType.Ascii } }; string ext = Path.GetExtension(path).ToLower(); if (extToTypeMap.ContainsKey(ext)) { return(CreateReader(extToTypeMap[ext], path, baseOptions)); } return(null); }
public AsciiReader(IOptionsSet options) : base(new AsciiReaderOptions(options)) { }
public FileOptionsSet(IOptionsSet other) : base(other) { }
public AsciiReaderOptions(IOptionsSet other) : base(other) { }
public DbfReaderOptions(IOptionsSet other) : base(other) { }
public IFormatReader <IFileOptionsSet> CreateReader(ReaderType type, string path, IOptionsSet baseOptions = null) { IFormatReader <IFileOptionsSet> result = null; FileOptionsSet options = new FileOptionsSet(baseOptions ?? OptionsSet.Empty) { FilePath = path }; switch (type) { case ReaderType.Ascii: result = new AsciiReader(options); break; case ReaderType.Excel: case ReaderType.Excel2007: result = new XlsReader(options); break; case ReaderType.Dbf: result = new DbfReader(options); break; case ReaderType.Db: throw new InvalidOperationException("use CreateDbReader()"); default: throw new UnimplementedReaderTypeException(type); } return(result); }
public IEnumerable <IFormatReader <IFileOptionsSet> > CreateDirectoryReader(string path, string pattern = null, IOptionsSet baseOptions = null) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException("path"); } if (Path.HasExtension(path)) { path = Path.GetDirectoryName(path); } Regex re = (String.IsNullOrEmpty(pattern) ? null : new Regex(pattern, RegexOptions.IgnoreCase)); var files = Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly); foreach (var filePath in files) { if (re == null || re.IsMatch(filePath)) { var reader = CreateReaderByExtension(filePath, baseOptions); if (reader != null) { yield return(reader); } } } }
public XlsReader(IOptionsSet options) : base(new XlsReaderOptions(options)) { }
public DbfReader(IOptionsSet options) : base(new DbfReaderOptions(options)) { }
public XlsReaderOptions(IOptionsSet other) : base(other) { }
private OptionsSet(IOptionsSet other, bool isReadonly) : this(other) { _readonly = isReadonly; }