mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
This allows us to make it obsolete to *inherit* from a class, and only that. Intended so people stop inheriting UI controls for no good reason. Fixes #5856
29 lines
791 B
C#
29 lines
791 B
C#
using System;
|
|
|
|
namespace Robust.Shared.Analyzers;
|
|
|
|
/// <summary>
|
|
/// Indicates that the ability to <i>inherit</i> this type is obsolete, and attempting to do so should give a warning.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is useful to gracefully deal with types that should never have had <see cref="VirtualAttribute"/>.
|
|
/// </remarks>
|
|
/// <seealso cref="VirtualAttribute"/>
|
|
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
|
public sealed class ObsoleteInheritanceAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// An optional message provided alongside this obsoletion.
|
|
/// </summary>
|
|
public string? Message { get; }
|
|
|
|
public ObsoleteInheritanceAttribute()
|
|
{
|
|
}
|
|
|
|
public ObsoleteInheritanceAttribute(string message)
|
|
{
|
|
Message = message;
|
|
}
|
|
}
|