Search Results for

    Show / Hide Table of Contents

    Class ContentDirectory

    The content directory class.

    Inheritance
    object
    ContentElement
    ContentDirectory
    Inherited Members
    ContentElement.Name
    ContentElement.RelativePath
    ContentElement.ParentDirectory
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Evergine.Assets.Contents
    Assembly: Evergine.Assets.dll
    Syntax
    public class ContentDirectory : ContentElement

    Constructors

    ContentDirectory(string)

    Initializes a new instance of the ContentDirectory class.

    Declaration
    public ContentDirectory(string rootDirectory)
    Parameters
    Type Name Description
    string rootDirectory

    The parent directory.

    ContentDirectory(string, ContentDirectory)

    Initializes a new instance of the ContentDirectory class.

    Declaration
    public ContentDirectory(string directoryName, ContentDirectory parentDirectory)
    Parameters
    Type Name Description
    string directoryName

    The directory name.

    ContentDirectory parentDirectory

    The parent directory.

    Properties

    DirectoryInfo

    Gets the directory info.

    Declaration
    public DirectoryInfo DirectoryInfo { get; }
    Property Value
    Type Description
    DirectoryInfo

    DirtyPath

    Gets or sets a value indicating whether the path is dirty and needs to be recalculated.

    Declaration
    public override bool DirtyPath { get; set; }
    Property Value
    Type Description
    bool
    Overrides
    ContentElement.DirtyPath

    Files

    Gets the files of the directory.

    Declaration
    public ConcurrentDictionary<string, ContentFile> Files { get; }
    Property Value
    Type Description
    ConcurrentDictionary<string, ContentFile>

    FullPath

    Gets the full path.

    Declaration
    public override string FullPath { get; }
    Property Value
    Type Description
    string
    Overrides
    ContentElement.FullPath

    LastModified

    Gets the latest modified time.

    Declaration
    public override DateTime LastModified { get; }
    Property Value
    Type Description
    DateTime
    Overrides
    ContentElement.LastModified

    SubDirectories

    Gets the subdirectories of the directory.

    Declaration
    public ConcurrentDictionary<string, ContentDirectory> SubDirectories { get; }
    Property Value
    Type Description
    ConcurrentDictionary<string, ContentDirectory>

    Methods

    ContainsDirectory(string)

    Checks if the directory contains a defined directory.

    Declaration
    public bool ContainsDirectory(string name)
    Parameters
    Type Name Description
    string name

    The name of the directory to search.

    Returns
    Type Description
    bool

    True if exists. False otherwise.

    ContainsElement(string)

    Checks if the directory contains a defined element.

    Declaration
    public bool ContainsElement(string name)
    Parameters
    Type Name Description
    string name

    The name of the element to search.

    Returns
    Type Description
    bool

    True if exists. False otherwise.

    ContainsFile(string)

    Checks if the directory contains a defined file.

    Declaration
    public bool ContainsFile(string name)
    Parameters
    Type Name Description
    string name

    The name of the file to search.

    Returns
    Type Description
    bool

    True if exists. False otherwise.

    CreateContentFile(string, out ContentFile)

    Creates a sub directory.

    Declaration
    public FileStream CreateContentFile(string fileName, out ContentFile file)
    Parameters
    Type Name Description
    string fileName

    The name of the subdirectory.

    ContentFile file

    The content file.

    Returns
    Type Description
    FileStream

    The write stream.

    CreateSubDirectory(string)

    Creates a sub directory.

    Declaration
    public ContentDirectory CreateSubDirectory(string name)
    Parameters
    Type Name Description
    string name

    The name of the subdirectory.

    Returns
    Type Description
    ContentDirectory

    The contentDirectory object.

    Delete()

    Deletes the file.

    Declaration
    public override void Delete()
    Overrides
    ContentElement.Delete()

    FindDirectoryByName(string)

    Gets a sub directory contained in the directory by its name.

    Declaration
    public ContentDirectory FindDirectoryByName(string name)
    Parameters
    Type Name Description
    string name

    The name of the directory to search.

    Returns
    Type Description
    ContentDirectory

    The directory if exists. False otherwise.

    FindFileByName(string)

    Gets a file contained in the directory by its name.

    Declaration
    public ContentFile FindFileByName(string name)
    Parameters
    Type Name Description
    string name

    The name of the file to search.

    Returns
    Type Description
    ContentFile

    The file if exists. False otherwise.

    FindFilesByExtension(IEnumerable<string>)

    Gets all the files of the directory with a specific set of extensions.

    Declaration
    public List<ContentFile> FindFilesByExtension(IEnumerable<string> extensions)
    Parameters
    Type Name Description
    IEnumerable<string> extensions

    The extension enumerable.

    Returns
    Type Description
    List<ContentFile>

    The list of the files that satisfy the extensions.

    FindFilesByExtension(string)

    Gets all the files of the directory with a specific extension.

    Declaration
    public List<ContentFile> FindFilesByExtension(string extension)
    Parameters
    Type Name Description
    string extension

    The extension.

    Returns
    Type Description
    List<ContentFile>

    The list of the files.

    Move(ContentDirectory)

    Moves the element to a new directory.

    Declaration
    public override bool Move(ContentDirectory newParentDirectory)
    Parameters
    Type Name Description
    ContentDirectory newParentDirectory

    The new parent Content Directory.

    Returns
    Type Description
    bool

    True if it was successful.

    Overrides
    ContentElement.Move(ContentDirectory)

    Refresh()

    Refreshes the element, setting its path to dirty mode.

    Declaration
    public override void Refresh()
    Overrides
    ContentElement.Refresh()

    SetName(string)

    Sets a new name for the directory.

    Declaration
    public override bool SetName(string newName)
    Parameters
    Type Name Description
    string newName

    The new name.

    Returns
    Type Description
    bool

    If the change of name could be achieved.

    Overrides
    ContentElement.SetName(string)

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    UpdateName(string)

    Updates the name of the element.

    Declaration
    public override bool UpdateName(string newName)
    Parameters
    Type Name Description
    string newName

    The new name of the element.

    Returns
    Type Description
    bool

    True if the operation was succesful. False otherwise.

    Overrides
    ContentElement.UpdateName(string)

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In This Article
    Back to top
    Generated by DocFX