Class ComputedIdentifierAttribute
- Namespace
- OpenSettings.Attributes
- Assembly
- OpenSettings.dll
Attribute used to assign a unique identifier (GUID) to setting classes. The computed identifier is either provided directly as a GUID or is computed based on the class full name (or other string identifier) using an MD5 hash of the UTF-8 bytes of the string. This allows each setting to have a unique identifier.
[AttributeUsage(AttributeTargets.Class)]
public class ComputedIdentifierAttribute : Attribute
- Inheritance
-
ComputedIdentifierAttribute
- Inherited Members
Constructors
ComputedIdentifierAttribute(string)
Initializes a new instance of the ComputedIdentifierAttribute class. The constructor attempts to parse the provided identifier as a GUID. If the string cannot be parsed as a GUID, the identifier is computed using an MD5 hash of the UTF-8 bytes of the string, typically representing the class name or other unique setting identifier.
public ComputedIdentifierAttribute(string identifier)
Parameters
identifier
stringA string that can either be a GUID or a class name (or another string) representing a setting's unique identifier.
Properties
ComputedIdentifier
Gets the computed or provided GUID that uniquely identifies the setting class.
public Guid ComputedIdentifier { get; }