/// <summary> /// Extension method to check if the file is supported by the <see cref="ICustomDataSource"/>. /// </summary> /// <param name="filePath"> /// Full path to the file being checked. /// </param> /// <returns> /// <inheritdoc cref="ICustomDataSource.IsFileSupported(string)"/> /// </returns> public static bool Supports(this ICustomDataSource self, string filePath) { var supportedExtension = FileExtensionUtils.CanonicalizeExtension(self.TryGetFileExtension()); var fileExtension = FileExtensionUtils.CanonicalizeExtension(Path.GetExtension(filePath)); // Should this be invariant culture? return(StringComparer.CurrentCultureIgnoreCase.Equals(fileExtension, supportedExtension) && self.IsFileSupported(filePath)); }