Class MediaType.FileValidation
Used to determine whether the MediaFile is respecting the EMS's rulesets for this MediaType.
Inheritance
System.Object
MediaType.FileValidation
Assembly: Appearition.SDK.dll
[Serializable]
public class FileValidation
Constructors
Declaration
Declaration
public FileValidation(MediaType.FileValidation cc)
Parameters
Properties
Declaration
public bool AllowFileNameWhitespace { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Declaration
public bool AllowSameNamedFile { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Declaration
public bool CheckForInvalidFileNameChars { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Declaration
public int Id { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public string InvalidFileNameCharsCsv { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public int MaxHeight { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public int MaxWidth { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public string MediaTypeName { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public int MinHeight { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public int MinWidth { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public string Notes { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public string PlatformType { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public string ValidFileMimeTypeCsv { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public string ValidFileNameExtensionCsv { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public int ValidFileSizeInBytes { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public int ValidFileSizeInKBytes { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Declaration
public int ValidFileSizeInMBytes { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Methods
Returns whether or not this File Validation contains the given extension as a rule.
Declaration
public bool ContainsExtension(string extension)
Parameters
| Type |
Name |
Description |
| System.String |
extension |
Extension.
|
Returns
| Type |
Description |
| System.Boolean |
true, if extension was containsed, false otherwise.
|
Returns all the invalid characters a filename cannot have, as a char array.
Declaration
public char[] GetAllInvalidCharacters()
Returns
| Type |
Description |
| System.Char[] |
|
Returns a list of all the file extensions allowed for this file validation.
Declaration
public string[] GetFileExtensions(bool includeDot = true)
Parameters
| Type |
Name |
Description |
| System.Boolean |
includeDot |
If set to true include dot.
|
Returns
| Type |
Description |
| System.String[] |
The file extensions.
|
From a given extension, finds and fetches a mimetype.
Declaration
public string GetMimeTypeForExtension(string extension)
Parameters
| Type |
Name |
Description |
| System.String |
extension |
Extension.
|
Returns
| Type |
Description |
| System.String |
The MIME type for extension.
|
Returns a container with all available mimetypes for this file validation.
Declaration
public string[] GetMimeTypes()
Returns
| Type |
Description |
| System.String[] |
The MIME types.
|
Handle the file validation for this specific file validation content.
The MediaType should be having the final word on whether the file is valid or not.
Declaration
public bool IsFileValid(string fileNameWithExtension, int fileSizeInBytes)
Parameters
| Type |
Name |
Description |
| System.String |
fileNameWithExtension |
File name with extension.
|
| System.Int32 |
fileSizeInBytes |
File size in bytes.
|
Returns
| Type |
Description |
| System.Boolean |
true if this instance is file valid the specified fileNameWithExtension fileSizeInBytes; otherwise, false.
|
Extension Methods