Files
RobustToolbox/Robust.Shared.Utility/IoC/DependencyAttribute.cs
PJB3005 b7a3526131 Move RHI to its own project
Move some of Robust.Shared to a new project so it can be depended upon without adding longer dependency chains.
2025-10-07 18:18:48 +02:00

25 lines
1006 B
C#

namespace Robust.Shared.IoC
{
/// <summary>
/// Specifies that the field this is applied to is a dependency,
/// which will be resolved by <see cref="IDependencyCollection" /> when the containing class is instantiated.
/// </summary>
/// <remarks>
/// <para>
/// The dependency is resolved as if <see cref="IDependencyCollection.Resolve{T}()" /> were to be called,
/// but it avoids circular references and init order issues due to internal code in the <see cref="IDependencyCollection" />.
/// </para>
/// <para>
/// The dependency can be injected into read only fields without issues,
/// and as a matter of fact it is recommended to use read only fields.
/// </para>
/// <para>
/// If you would like to run code after the dependencies have been injected, use <see cref="IPostInjectInit" />
/// </para>
/// </remarks>
[AttributeUsage(AttributeTargets.Field)]
public sealed class DependencyAttribute : Attribute
{
}
}