Class AssetManager
- Namespace
- Alis.Core.Aspect.Data.Resource
- Assembly
- Alis.dll
The example class
public static class AssetManager
Inheritance
Inherited Members
Methods
Find(string)
Finds the asset name in the "assets" folder and its subdirectories.
public static string Find(string assetName)
Parameters
assetName
string-
The asset name.
Returns
- string
-
The full path of the asset if found; otherwise, an empty string.
GetAssetsDirectory()
Gets the assets directory
internal static string GetAssetsDirectory()
Returns
- string
-
The string
GetFilePath(string[])
Gets the file path using the specified files
internal static string GetFilePath(string[] files)
Parameters
files
string[]-
The files
Returns
- string
-
The string
GetFilesInAssetsDirectory(string, string)
Gets the files in assets directory using the specified assets directory
internal static string[] GetFilesInAssetsDirectory(string assetsDirectory, string assetName)
Parameters
Returns
- string[]
-
The string array
IsInvalidAssetName(string)
Checks if the asset name has any invalid characters
internal static bool IsInvalidAssetName(string assetName)
Parameters
assetName
string-
The asset name
Returns
- bool
-
True if the asset name is invalid, false otherwise
ValidateAssetName(string)
Validates the asset name using the specified asset name
internal static void ValidateAssetName(string assetName)
Parameters
assetName
string-
The asset name
ValidateAssetNameHasExtension(string)
Validates the asset name has extension using the specified asset name
internal static void ValidateAssetNameHasExtension(string assetName)
Parameters
assetName
string-
The asset name
Exceptions
- ArgumentException
-
The asset name must have extension.
ValidateAssetNameHasNoInvalidChars(string)
Validates the asset name has no invalid chars using the specified asset name
internal static void ValidateAssetNameHasNoInvalidChars(string assetName)
Parameters
assetName
string-
The asset name
Exceptions
- ArgumentException
-
The asset name contains invalid characters.
ValidateAssetNameIsNotEmpty(string)
Validates the asset name is not empty using the specified asset name
internal static void ValidateAssetNameIsNotEmpty(string assetName)
Parameters
assetName
string-
The asset name
Exceptions
- ArgumentException
-
The asset name cannot be empty.
ValidateAssetNameIsNotNull(string)
Validates the asset name is not null using the specified asset name
internal static void ValidateAssetNameIsNotNull(string assetName)
Parameters
assetName
string-
The asset name
Exceptions
ValidateFileCount(string[], string)
Validates the file count using the specified files
internal static void ValidateFileCount(string[] files, string assetName)
Parameters
Exceptions
- InvalidOperationException
-
Multiple files with the name '{assetName}' were found. Unable to determine the correct file.