Class FileAndPathValidations
System.Windows.Controls.ValidationRules for files and paths.
Inherited Members
Namespace: Loehnert.Lisrt.Scripting
Assembly: Loehnert.Lisrt.Scripting.dll
Syntax
public static class FileAndPathValidations
Methods
ValidateItemContainsAnyChars(String)
Validates that the file name has any chars.
Declaration
public static ValidationResult ValidateItemContainsAnyChars(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | File name to validate. |
Returns
Type | Description |
---|---|
System.Windows.Controls.ValidationResult | The validation result. |
ValidateItemContainsNoInvalidFileNameChars(String)
Validates that the name does not contains invalid file name chars.
Declaration
public static ValidationResult ValidateItemContainsNoInvalidFileNameChars(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the new item. |
Returns
Type | Description |
---|---|
System.Windows.Controls.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.
Declaration
public static ValidationResult ValidateItemWithThisNameNotExistsAsDirectory(string path, string name)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path to the file (with or without file name). |
String | name | Name of the file, with extension. |
Returns
Type | Description |
---|---|
System.Windows.Controls.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.
Declaration
public static ValidationResult ValidateItemWithThisNameNotExistsAsFile(string path, string name)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path to the file. |
String | name | Name of the file, with extension. |
Returns
Type | Description |
---|---|
System.Windows.Controls.ValidationResult | The validation result. |
ValidatePathContainsNoInvalidPathChars(String)
Validates that the path does not contains invalid path chars.
Declaration
public static ValidationResult ValidatePathContainsNoInvalidPathChars(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Any path. |
Returns
Type | Description |
---|---|
System.Windows.Controls.ValidationResult | The validation result. |
ValidatePathIsRooted(String)
Validates that the path is rooted.
Declaration
public static ValidationResult ValidatePathIsRooted(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Any path without file name. |
Returns
Type | Description |
---|---|
System.Windows.Controls.ValidationResult | The validation result. |
ValidateProjectItemWithThisNameNotExistsAsObject(String, ICompositeProjectItem)
Validates that a IProjectItem with the same name not already exists as sub item.
Declaration
public static ValidationResult ValidateProjectItemWithThisNameNotExistsAsObject(string key, ICompositeProjectItem parent)
Parameters
Type | Name | Description |
---|---|---|
String | key | Name as key of the new item. |
ICompositeProjectItem | parent | Parent to which the item should be added. |
Returns
Type | Description |
---|---|
System.Windows.Controls.ValidationResult | The validation result. |