// // PacketHeaderAttribute.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace NosSmooth.PacketSerializer.Abstractions.Attributes; /// /// Attribute for specifying the header identifier of the packet. /// [AttributeUsage(AttributeTargets.Class)] public class PacketHeaderAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// The packet identifier (the first entry). /// The source of the packet. public PacketHeaderAttribute(string? identifier, PacketSource source) { Identifier = identifier; Source = source; } /// /// Gets the identifier of the packet (the first entry in the packet). /// public string? Identifier { get; } /// /// Gets the source of the packet used for determining where the packet is from. /// public PacketSource Source { get; } }