RaspberryIO/Unosquare.Swan.Lite/Attributes/StructEndiannessAttribute.cs

27 lines
877 B
C#
Raw Normal View History

2019-12-04 17:10:06 +01:00
using System;
namespace Unosquare.Swan.Attributes {
/// <summary>
/// An attribute used to help conversion structs back and forth into arrays of bytes via
/// extension methods included in this library ToStruct and ToBytes.
/// </summary>
/// <seealso cref="Attribute" />
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Struct)]
public class StructEndiannessAttribute : Attribute {
2019-02-17 14:08:57 +01:00
/// <summary>
2019-12-04 17:10:06 +01:00
/// Initializes a new instance of the <see cref="StructEndiannessAttribute"/> class.
2019-02-17 14:08:57 +01:00
/// </summary>
2019-12-04 17:10:06 +01:00
/// <param name="endianness">The endianness.</param>
public StructEndiannessAttribute(Endianness endianness) => this.Endianness = endianness;
/// <summary>
/// Gets the endianness.
/// </summary>
/// <value>
/// The endianness.
/// </value>
public Endianness Endianness {
get;
}
}
2019-02-17 14:08:57 +01:00
}