Class GS1Codetext

GS1Codetext class

Represents GS1 codetext for encoding and decoding as an ordered sequence of Application Identifier elements. Source order and repeated Application Identifiers are preserved. The bracketed representation has the form (AI)value(AI)value. A literal opening parenthesis ‘(’ inside a value must be written as (; this is the only supported escape sequence. A closing parenthesis ‘)’ inside a value does not require escaping.

public sealed class GS1Codetext : IComplexCodetext

Constructors

NameDescription
GS1Codetext()The default constructor.

Properties

NameDescription
BarcodeType { get; set; }Gets or sets the barcode type used to encode this GS1 codetext. Supported types are GS1Aztec, GS1CodablockF, GS1Code128, GS1DataMatrix, GS1DotCode, GS1HanXin, GS1MicroPdf417, GS1QR and GS1 DataBar types. The default value is GS1Code128.
Count { get; }Gets the number of Application Identifier elements.
Elements { get; }Gets a copy of all elements in source order.
Item { get; }Gets an element by its position in the ordered sequence.

Methods

NameDescription
static Parse(string)Parses a bracketed GS1 element string in the form (AI)value(AI)value. A literal ‘(’ inside a value must be written as (; no other escape sequence is supported, and ‘)’ does not require escaping.
Add(string, string)Appends a validated Application Identifier element.
GetAll(string)Gets all values for an Application Identifier in source order.
GetBarcodeType()Gets the barcode type used to encode this GS1 codetext.
GetConstructedCodetext()Constructs the bracketed GS1 codetext in the form (AI)value(AI)value. Literal opening parentheses in values are escaped as (.
GetFirst(string)Gets the first value for an Application Identifier.
InitFromString(string)Initializes this instance from bracketed GS1 codetext in the form (AI)value(AI)value. Existing elements are replaced only after the supplied codetext has been parsed successfully.
override ToString()Returns the bracketed GS1 representation in the form (AI)value(AI)value.
static TryParse(string, out GS1Codetext, out GS1ValidationResult)Attempts to parse a bracketed GS1 element string in the form (AI)value(AI)value and returns structured validation errors. A literal ‘(’ inside a value must be written as (; no other escape sequence is supported, and ‘)’ does not require escaping.
static Validate(string)Validates a bracketed GS1 element string in the form (AI)value(AI)value without constructing an object. A literal ‘(’ inside a value must be written as (; no other escape sequence is supported, and ‘)’ does not require escaping.

See Also