Open sandboxFocus

Method GetService

GetService<T>(bool)

Gets a build-time service exposed by PostSharp.

Declaration
T GetService<T>(bool throwing = true) where T : class, IService
Parameters
Type Name Description
bool throwing

true if an exception should be thrown when the service cannot be acquired, otherwise false. The default value is true.

Returns
Type Description
T

The service T, or null if the service could not be acquired and throwing was set to false.

Type Parameters
Name Description
T

An interface derived from IService.