Table of Contents

Class FileAndPathValidations

Namespace
Loehnert.Lisrt.Scripting
Assembly
Loehnert.Lisrt.Scripting.dll

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 string

File 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 string

Name 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 string

Path to the file (with or without file name).

name string

Name 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

path string

Path to the file.

name string

Name of the file, with extension.

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 string

Any path.

Returns

ValidationResult

The validation result.

ValidatePathIsRooted(string)

Validates that the path is rooted.

public static ValidationResult ValidatePathIsRooted(string path)

Parameters

path string

Any 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 string

Name as key of the new item.

parent ICompositeProjectItem

Parent to which the item should be added.

Returns

ValidationResult

The validation result.