Open sandboxFocus

Method GetDeclaration

GetDeclaration(string, string, string, bool)

Gets a declaration in the current project set by its serialized identifier.

Declaration
IDeclaration? GetDeclaration(string projectName, string targetFramework, string declarationId, bool metalamaOutput)
Parameters
Type Name Description
string projectName

The name of the project.

string targetFramework

The target framework, or an empty string.

string declarationId

The serialized identifier of the declaration, obtained with ToSerializableId().

bool metalamaOutput

Indicates whether to look for the declaration in Metalama's transformed output (true) or in the source code (false).

Returns
Type Description
IDeclaration

The declaration, or null if not found.