Files
DP44/docs/ai/Common/DTS.Common.Storage/Classes/Static.md
2026-04-17 14:55:32 -04:00

2.0 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common.Storage/Classes/Static/CustomChannelFieldSizeAttribute.cs
2026-04-17T16:38:14.601225+00:00 zai-org/GLM-5-FP8 1 b80f469f3a04031c

Documentation: CustomChannelFieldSizeAttribute.cs

1. Purpose

This module provides a mechanism for associating size metadata with enum values, specifically for the MMETables.MMEPossibleChannelsFields enum. It defines a custom attribute CustomChannelFieldSizeAttribute to store integer size values, and supplies extension methods for retrieving both this specific attribute and generic attributes from enum values via reflection. This enables declarative configuration of field sizes directly on enum members.


2. Public Interface

CustomChannelFieldSizeAttribute (Class)

A custom attribute that stores an integer size value.

Member Signature Description
Constructor internal CustomChannelFieldSizeAttribute(int size) Creates an instance with the specified size. Note: Constructor is internal.
Property public int Size { get; private set; } Read-only property returning the size value.

CustomChannelFieldSizeExtensions (Static Class)

Provides extension methods for retrieving field size from enum values.

Method Signature Description
GetFieldSize public static int GetFieldSize(MMETables.MMEPossibleChannelsFields field) Retrieves the Size value from the CustomChannelFieldSizeAttribute applied to the given enum value.

EnumExtensions (Static Class)

Provides a generic extension method for retrieving attributes from enum values.

Method Signature Description
GetAttribute<TAttribute> public static TAttribute GetAttribute<TAttribute>(this Enum value) where TAttribute : Attribute Retrieves a single attribute of type TAttribute from the given enum value using