23 lines
960 B
C#
Raw Permalink Normal View History

2021-09-20 18:20:01 +02:00
#if NETFRAMEWORK
namespace System.Diagnostics.CodeAnalysis {
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
sealed class NotNullWhenAttribute : Attribute {
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
sealed class DoesNotReturnIfAttribute : Attribute {
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
public bool ParameterValue { get; }
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
sealed class AllowNullAttribute : Attribute {
public AllowNullAttribute() { }
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
sealed class DisallowNullAttribute : Attribute {
public DisallowNullAttribute() { }
}
}
#endif