Class FileAndPathValidations
ValidationRules for files and paths.
public static class FileAndPathValidations
- Inheritance
-
FileAndPathValidations
- Inherited Members
Methods
ValidateItemContainsAnyChars(string)
Validates that the file name has any chars.
public static ValidationResult ValidateItemContainsAnyChars(string name)
Parameters
name
stringFile name to validate.
Returns
- ValidationResult
The validation result.
ValidateItemContainsNoInvalidFileNameChars(string)
Validates that the name does not contains invalid file name chars.
public static ValidationResult ValidateItemContainsNoInvalidFileNameChars(string name)
Parameters
name
stringName of the new item.
Returns
- ValidationResult
The validation result.
ValidateItemWithThisNameNotExistsAsDirectory(string, string)
Validates that a directory with the same name not already exists on the file system in the path.
public static ValidationResult ValidateItemWithThisNameNotExistsAsDirectory(string path, string name)
Parameters
path
stringPath to the file (with or without file name).
name
stringName of the file, with extension.
Returns
- ValidationResult
The validation result.
ValidateItemWithThisNameNotExistsAsFile(string, string)
Validates that a file with the same name not already exists on the file system in the path.
public static ValidationResult ValidateItemWithThisNameNotExistsAsFile(string path, string name)
Parameters
Returns
- ValidationResult
The validation result.
ValidatePathContainsNoInvalidPathChars(string)
Validates that the path does not contains invalid path chars.
public static ValidationResult ValidatePathContainsNoInvalidPathChars(string path)
Parameters
path
stringAny path.
Returns
- ValidationResult
The validation result.
ValidatePathIsRooted(string)
Validates that the path is rooted.
public static ValidationResult ValidatePathIsRooted(string path)
Parameters
path
stringAny path without file name.
Returns
- ValidationResult
The validation result.
ValidateProjectItemWithThisNameNotExistsAsObject(string, ICompositeProjectItem)
Validates that a IProjectItem with the same name not already exists as sub item.
public static ValidationResult ValidateProjectItemWithThisNameNotExistsAsObject(string key, ICompositeProjectItem parent)
Parameters
key
stringName as key of the new item.
parent
ICompositeProjectItemParent to which the item should be added.
Returns
- ValidationResult
The validation result.