/// <summary> /// Extension method to get the canonical file extension for a <see cref="CustomDataSourceReference"/>. /// </summary> /// <returns> /// <inheritdoc cref="FileExtensionUtils.CanonicalizeExtension(string)"/> /// </returns> public static string TryGetCanonicalFileExtension(this CustomDataSourceReference self) { var fileDataSource = self.DataSource as FileDataSourceAttribute; var fileDataSourceExtension = fileDataSource?.FileExtension; return(FileExtensionUtils.CanonicalizeExtension(fileDataSourceExtension)); }
/// <summary> /// Initializes a new instance of the <see cref="DataSessionSource"/> /// class. /// </summary> public DataSessionSource( CustomDataSourceReference customDataSource, IEnumerable <IDataSource> dataSources, ProcessorOptions options) { Guard.NotNull(customDataSource, nameof(customDataSource)); Guard.NotNull(dataSources, nameof(dataSources)); Guard.NotNull(options, nameof(options)); this.CustomDataSource = customDataSource; this.DataSources = dataSources.ToList().AsReadOnly(); this.Options = options; this.ProgressTracker = new DataProcessorProgress(); }
/// <summary> /// Extension method to check if the file is supported by the <see cref="CustomDataSourceReference"/>. /// </summary> /// <param name="filePath"> /// <inheritdoc cref="CustomDataSourceExtensions.Supports(ICustomDataSource, string)"/> /// </param> /// <returns> /// <inheritdoc cref="CustomDataSourceExtensions.Supports(ICustomDataSource, string)"/> /// </returns> public static bool Supports( this CustomDataSourceReference self, string filePath) { return(self.Instance.Supports(filePath)); }
/// <summary> /// Extension method to get the description for a <see cref="CustomDataSourceReference"/>. /// </summary> /// <returns> /// <inheritdoc cref="CustomDataSourceExtensions.TryGetFileDescription(ICustomDataSource)"/> /// </returns> public static string TryGetFileDescription(this CustomDataSourceReference self) { var fileDataSource = self.DataSource as FileDataSourceAttribute; return(fileDataSource?.Description); }