Exemplo n.º 1
0
 /// <summary>
 /// Создать папку для сохранения отконвертированных файлов по типу расширения
 /// </summary>
 public static string CreateSavingPath(string filePathServer, FileExtensionType fileExtensionType,
                                       IFileSystemOperations fileSystemOperations) =>
 Path.GetDirectoryName(filePathServer).
 Map(directory => fileSystemOperations.CreateFolderByName(Path.Combine(directory, Path.GetFileNameWithoutExtension(filePathServer)),
                                                          fileExtensionType.ToString())).
 Map(serverDirectory => FilePathOperations.CombineFilePath(serverDirectory,
                                                           Path.GetFileNameWithoutExtension(filePathServer),
                                                           fileExtensionType.ToString().ToLowerCaseCurrentCulture()));
Exemplo n.º 2
0
 /// <summary>
 /// Сравнить расширения
 /// </summary>
 public static bool IsFileExtensionEqual(string fileExtension, FileExtensionType extensionTypeCompare) =>
 extensionTypeCompare.ToString().ToLowerCaseCurrentCulture() ==
 FilePathOperations.ExtensionWithoutPoint(fileExtension).ToLowerCaseCurrentCulture();