Project Current { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Current property of the Sandbox.Project class provides access to the currently open project within the Sandbox environment. This property is static, meaning it can be accessed without instantiating the Project class. It is useful for retrieving information about the project that is currently being worked on, such as its configuration, paths, and status.

Usage

To access the current project, simply use the Sandbox.Project.Current property. This will return an instance of the Project class representing the open project. You can then use this instance to access various properties and methods related to the project.

Example

// Access the current project
Project currentProject = Project.Current;

// Check if the current project is active
bool isActive = currentProject.Active;

// Get the root path of the current project
string rootPath = currentProject.GetRootPath();

// Determine if the project has a code path
bool hasCodePath = currentProject.HasCodePath();