Class Sealed
public sealed class TableFieldAttribute : Attribute

Namespace: SharpMeter.Core.Tables.Attributes

Marks a property as a PSEM table field, specifying its byte offset, size, and data type.

Inheritance

Inherits from: Attribute

Constructors

NameDescription
TableFieldAttribute(…) Marks a property as a PSEM table field, specifying its byte offset, size, and data type.

TableFieldAttribute(int offset, int size, FieldType type)

TableFieldAttribute.TableFieldAttribute(int offset, int size, FieldType type = FieldType.Hex)

Marks a property as a PSEM table field, specifying its byte offset, size, and data type.

Parameters

NameTypeDescription
offsetintThe byte offset within the table.
sizeintThe field size in bytes.
typeSharpMeter.Core.Tables.FieldTypeThe field data type for interpretation.

Properties

NameDescription
Description Gets or sets the human-readable description.
IsReadOnly Gets or sets whether this field is read-only.
Offset Gets the byte offset within the table.
Size Gets the field size in bytes.
Type Gets the data type for interpretation.

Description

string TableFieldAttribute.Description { get; set; }

Gets or sets the human-readable description.

IsReadOnly

bool TableFieldAttribute.IsReadOnly { get; set; }

Gets or sets whether this field is read-only.

Offset

int TableFieldAttribute.Offset { get; }

Gets the byte offset within the table.

Size

int TableFieldAttribute.Size { get; }

Gets the field size in bytes.

Type

FieldType TableFieldAttribute.Type { get; }

Gets the data type for interpretation.

Type Relationships
classDiagram
                    style TableFieldAttribute fill:#f9f,stroke:#333,stroke-width:2px
                    TableFieldAttribute --|> Attribute : inherits
                
View Source
/// <summary>
///     Marks a property as a PSEM table field, specifying its byte offset, size, and data type.
/// </summary>
/// <param name = "offset">The byte offset within the table.</param>
/// <param name = "size">The field size in bytes.</param>
/// <param name = "type">The field data type for interpretation.</param>
[AttributeUsage(AttributeTargets.Property)]
public sealed class TableFieldAttribute(int offset, int size, FieldType type = FieldType.Hex) : Attribute
{
#region Properties
    /// <summary>Gets the byte offset within the table.</summary>
    public int Offset { get; } = offset;
    /// <summary>Gets the field size in bytes.</summary>
    public int Size { get; } = size;
    /// <summary>Gets the data type for interpretation.</summary>
    public FieldType Type { get; } = type;
    /// <summary>Gets or sets the human-readable description.</summary>
    public string Description { get; set; } = string.Empty;
    /// <summary>Gets or sets whether this field is read-only.</summary>
    public bool IsReadOnly { get; set; }
#endregion
}
Was this page helpful?