| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | #nullable enable |
| | 4 | |
|
| | 5 | | namespace Ice; |
| | 6 | |
|
| | 7 | | /// <summary>Assigns a Slice type ID to a class or interface.</summary> |
| | 8 | | /// <remarks>The Slice compiler assigns Slice type IDs to classes and interfaces it generates from Slice classes, |
| | 9 | | /// interfaces, and exceptions.</remarks> |
| | 10 | | // Corresponds to IceRPC's ZeroC.Slice.SliceTypeIdAttribute. |
| | 11 | | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = false)] |
| | 12 | | public sealed class SliceTypeIdAttribute : Attribute |
| | 13 | | { |
| | 14 | | /// <summary>Gets the Slice type ID.</summary> |
| | 15 | | /// <value>The Slice type ID string.</value> |
| 1 | 16 | | public string Value { get; } |
| | 17 | |
|
| | 18 | | /// <summary>Initializes a new instance of the <see cref="SliceTypeIdAttribute" /> class.</summary> |
| | 19 | | /// <param name="value">The Slice type ID.</param>> |
| 1 | 20 | | public SliceTypeIdAttribute(string value) => Value = value; |
| | 21 | | } |
| | 22 | |
|
| | 23 | | /// <summary>Assigns a compact Slice type ID to a class.</summary> |
| | 24 | | /// <remarks>The Slice compiler assigns both a Slice type ID and a compact Slice type ID to the mapped class of a Slice |
| | 25 | | /// class that specifies a compact type ID.</remarks> |
| | 26 | | [AttributeUsage(AttributeTargets.Class, Inherited = false)] |
| | 27 | | public sealed class CompactSliceTypeIdAttribute : Attribute |
| | 28 | | { |
| | 29 | | /// <summary>Gets the compact Slice type ID.</summary> |
| | 30 | | /// <value>The compact Slice type ID numeric value.</value> |
| | 31 | | public int Value { get; } |
| | 32 | |
|
| | 33 | | /// <summary>Initializes a new instance of the <see cref="CompactSliceTypeIdAttribute" /> class.</summary> |
| | 34 | | /// <param name="value">The compact type ID.</param>> |
| | 35 | | public CompactSliceTypeIdAttribute(int value) => Value = value; |
| | 36 | | } |