2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00
This commit is contained in:
2024-11-10 18:17:03 +03:00
parent 4603f66499
commit 0bed03abe3
7 changed files with 136 additions and 115 deletions

View File

@ -1,28 +1,23 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(
AttributeTargets.Class |
AttributeTargets.Event |
AttributeTargets.Field |
AttributeTargets.GenericParameter |
AttributeTargets.Parameter |
AttributeTargets.Property |
AttributeTargets.ReturnValue,
AllowMultiple = false,
Inherited = false)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
public sealed class NullableAttribute : Attribute
{
public readonly byte[] Flags;
//public readonly byte Flag;
/// <summary>Flags specifying metadata related to nullable reference types.</summary>
public readonly byte[] NullableFlags;
public NullableAttribute(byte flag)
/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flags value.</param>
public NullableAttribute(byte value)
{
//Flag = flag;
Flags = new byte[] { flag };
NullableFlags = new[] { value };
}
public NullableAttribute(byte[] flags)
/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flags value.</param>
public NullableAttribute(byte[] value)
{
Flags = flags;
NullableFlags = value;
}
}
}

View File

@ -1,19 +1,16 @@
namespace System.Runtime.CompilerServices
{
[System.AttributeUsage(
AttributeTargets.Class |
AttributeTargets.Delegate |
AttributeTargets.Interface |
AttributeTargets.Method |
AttributeTargets.Struct,
AllowMultiple = false,
Inherited = false)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
public sealed class NullableContextAttribute : Attribute
{
/// <summary>Flag specifying metadata related to nullable reference types.</summary>
public readonly byte Flag;
public NullableContextAttribute(byte flag)
/// <summary>Initializes the attribute.</summary>
/// <param name="value">The flag value.</param>
public NullableContextAttribute(byte value)
{
Flag = flag;
Flag = value;
}
}
}