Show / Hide Table of Contents

    Class MediaType.FileValidation

    Used to determine whether the MediaFile is respecting the EMS's rulesets for this MediaType.

    Inheritance
    System.Object
    MediaType.FileValidation
    Namespace: Appearition.Common
    Assembly: Appearition.SDK.dll
    Syntax
    [Serializable]
    public class FileValidation

    Constructors

    FileValidation()

    Declaration
    public FileValidation()

    FileValidation(MediaType.FileValidation)

    Copy Constructor

    Declaration
    public FileValidation(MediaType.FileValidation cc)
    Parameters
    Type Name Description
    MediaType.FileValidation cc

    C.

    Properties

    AllowFileNameWhitespace

    Declaration
    public bool AllowFileNameWhitespace { get; set; }
    Property Value
    Type Description
    System.Boolean

    AllowSameNamedFile

    Declaration
    public bool AllowSameNamedFile { get; set; }
    Property Value
    Type Description
    System.Boolean

    CheckForInvalidFileNameChars

    Declaration
    public bool CheckForInvalidFileNameChars { get; set; }
    Property Value
    Type Description
    System.Boolean

    Id

    Declaration
    public int Id { get; set; }
    Property Value
    Type Description
    System.Int32

    InvalidFileNameCharsCsv

    Declaration
    public string InvalidFileNameCharsCsv { get; set; }
    Property Value
    Type Description
    System.String

    MaxHeight

    Declaration
    public int MaxHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    MaxWidth

    Declaration
    public int MaxWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    MediaTypeName

    Declaration
    public string MediaTypeName { get; set; }
    Property Value
    Type Description
    System.String

    MinHeight

    Declaration
    public int MinHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    MinWidth

    Declaration
    public int MinWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    Notes

    Declaration
    public string Notes { get; set; }
    Property Value
    Type Description
    System.String

    PlatformType

    Declaration
    public string PlatformType { get; set; }
    Property Value
    Type Description
    System.String

    ValidFileMimeTypeCsv

    Declaration
    public string ValidFileMimeTypeCsv { get; set; }
    Property Value
    Type Description
    System.String

    ValidFileNameExtensionCsv

    Declaration
    public string ValidFileNameExtensionCsv { get; set; }
    Property Value
    Type Description
    System.String

    ValidFileSizeInBytes

    Declaration
    public int ValidFileSizeInBytes { get; set; }
    Property Value
    Type Description
    System.Int32

    ValidFileSizeInKBytes

    Declaration
    public int ValidFileSizeInKBytes { get; set; }
    Property Value
    Type Description
    System.Int32

    ValidFileSizeInMBytes

    Declaration
    public int ValidFileSizeInMBytes { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    ContainsExtension(String)

    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.

    GetAllInvalidCharacters()

    Returns all the invalid characters a filename cannot have, as a char array.

    Declaration
    public char[] GetAllInvalidCharacters()
    Returns
    Type Description
    System.Char[]

    GetFileExtensions(Boolean)

    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.

    GetMimeTypeForExtension(String)

    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.

    GetMimeTypes()

    Returns a container with all available mimetypes for this file validation.

    Declaration
    public string[] GetMimeTypes()
    Returns
    Type Description
    System.String[]

    The MIME types.

    IsFileValid(String, Int32)

    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

    ObjectExtension.ToStream(Object)
    Back to top Appearition SDK for Unity API