C# Класс Microsoft.DocAsCode.Utility.PathUtility

Показать файл Открыть проект

Открытые методы

Метод Описание
CopyFile ( string path, string targetPath, bool overwrite = false ) : void
CopyFilesToFolder ( this files, string sourceFolder, string destinationFolder, bool overwrite, Action messageHandler, bool>.Func errorHandler ) : IEnumerable
FormatPath ( this path, UriKind kind, string basePath = null ) : string

Also change backslash to forward slash

GetFileListFromFile ( string filePath ) : List
GetFullPath ( string folder, string href ) : string
IsPathUnderSpecificFolder ( string path, string folder ) : bool
IsRelativePath ( string path ) : bool
IsVaildFilePath ( string path ) : bool

http://stackoverflow.com/questions/422090/in-c-sharp-check-that-filename-is-possibly-valid-not-that-it-exists

MakeRelativePath ( string basePath, string absolutePath ) : string

Creates a relative path from one file or folder to another.

NormalizePath ( string path ) : string
SaveFileListToFile ( List fileList, string filePath ) : void
ToValidFilePath ( this input ) : string

Описание методов

CopyFile() публичный статический Метод

public static CopyFile ( string path, string targetPath, bool overwrite = false ) : void
path string
targetPath string
overwrite bool
Результат void

CopyFilesToFolder() публичный статический Метод

public static CopyFilesToFolder ( this files, string sourceFolder, string destinationFolder, bool overwrite, Action messageHandler, bool>.Func errorHandler ) : IEnumerable
files this
sourceFolder string
destinationFolder string
overwrite bool
messageHandler Action
errorHandler bool>.Func
Результат IEnumerable

FormatPath() публичный статический Метод

Also change backslash to forward slash
public static FormatPath ( this path, UriKind kind, string basePath = null ) : string
path this
kind UriKind
basePath string
Результат string

GetFileListFromFile() публичный статический Метод

public static GetFileListFromFile ( string filePath ) : List
filePath string
Результат List

GetFullPath() публичный статический Метод

public static GetFullPath ( string folder, string href ) : string
folder string
href string
Результат string

IsPathUnderSpecificFolder() публичный статический Метод

public static IsPathUnderSpecificFolder ( string path, string folder ) : bool
path string
folder string
Результат bool

IsRelativePath() публичный статический Метод

public static IsRelativePath ( string path ) : bool
path string
Результат bool

IsVaildFilePath() публичный статический Метод

http://stackoverflow.com/questions/422090/in-c-sharp-check-that-filename-is-possibly-valid-not-that-it-exists
public static IsVaildFilePath ( string path ) : bool
path string
Результат bool

MakeRelativePath() публичный статический Метод

Creates a relative path from one file or folder to another.
public static MakeRelativePath ( string basePath, string absolutePath ) : string
basePath string Contains the directory that defines the start of the relative path.
absolutePath string Contains the path that defines the endpoint of the relative path.
Результат string

NormalizePath() публичный статический Метод

public static NormalizePath ( string path ) : string
path string
Результат string

SaveFileListToFile() публичный статический Метод

public static SaveFileListToFile ( List fileList, string filePath ) : void
fileList List
filePath string
Результат void

ToValidFilePath() публичный статический Метод

public static ToValidFilePath ( this input ) : string
input this
Результат string