mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Move some of Robust.Shared to a new project so it can be depended upon without adding longer dependency chains.
25 lines
1006 B
C#
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
|
|
{
|
|
}
|
|
}
|