Description
The Directory
property of the ProjectConfig
class provides access to the directory that houses the addon. This property is of type System.IO.DirectoryInfo
, which provides methods and properties for creating, moving, and enumerating through directories and subdirectories.
This property is marked with the JsonIgnore
attribute, indicating that it will not be serialized when converting the ProjectConfig
object to JSON. Additionally, it is marked with the Hide
attribute, suggesting that it may not be intended for display in certain contexts, such as user interfaces.
Usage
To access the directory information of an addon, you can use the Directory
property of a ProjectConfig
instance. This property is read-only and provides a DirectoryInfo
object that can be used to perform various file system operations.
Note that since this property is marked with JsonIgnore
, it will not be included in JSON serialization, which is useful for keeping file system paths out of serialized data.
Example
// Example of accessing the Directory property
// Assume projectConfig is an instance of ProjectConfig
var projectConfig = new ProjectConfig();
// Access the directory information
System.IO.DirectoryInfo addonDirectory = projectConfig.Directory;
// Use the DirectoryInfo object to perform operations
if (addonDirectory.Exists)
{
// List all files in the directory
var files = addonDirectory.GetFiles();
foreach (var file in files)
{
// Process each file
Console.WriteLine(file.Name);
}
}