Gs1Element Class

Represents a GS1 element string: an application identifier (AI) and the data it qualifies, such as AI 01 (GTIN) and 09521234543213.

public sealed class Gs1Element

Remarks

The data does not include the parentheses of the human-readable interpretation: they are printed under the bars but are not encoded. The application identifier and the data are checked against the syntax rules every GS1 element follows, not against the GS1 dictionary of application identifiers (the format of the data of each identifier).

Constructors

NameDescription
Gs1Element(string, string)Initializes a new instance of the Gs1Element class.

Gs1Element(string, string)

Gs1Element.cs

Initializes a new instance of the Gs1Element class.

public Gs1Element(string applicationIdentifier, string value)

Parameters

applicationIdentifier string
The application identifier: 2 to 4 digits, without parentheses.
value string
The data: characters of the GS1 AI encodable character set 82 (letters, digits and !"%&'()*+,-./:;<=>?_). The application identifiers whose data has a predefined length (00 to 04, 11 to 20, 31nn to 36nn and 41n) require digits of that length.

Exceptions

ArgumentException
The application identifier or the data is not valid.

Properties

NameDescription
ApplicationIdentifierGets the application identifier, such as 01.
ValueGets the data that the application identifier qualifies.

ApplicationIdentifier

Gs1Element.cs

Gets the application identifier, such as 01.

public string ApplicationIdentifier { get; }

Property value

string

Gets the data that the application identifier qualifies.

public string Value { get; }

Property value

string

Methods

NameDescription
ToString()Returns the human-readable interpretation of the element string, such as (01)09521234543213.

ToString()

Gs1Element.cs

Returns the human-readable interpretation of the element string, such as (01)09521234543213.

public override string ToString()

Returns

string The application identifier in parentheses, followed by the data.