Class GS1DigitalLink

Represents GS1 Digital Link codetext for encoding and decoding as an ordered sequence of Application Identifier elements. Source order and repeated Application Identifiers are preserved. The constructed codetext is an uncompressed GS1 Digital Link URI. Non-GS1 query parameters and URI fragments are ignored when parsing.

public sealed class GS1DigitalLink : IComplexCodetext

Constructors

NameDescription
GS1DigitalLink(string)Initializes an empty GS1 Digital Link with the specified URI stem. The primary key is selected automatically when exactly one primary-key candidate is present.
GS1DigitalLink(string, string)Initializes an empty GS1 Digital Link with the specified URI stem and primary key.

Properties

NameDescription
BarcodeType { get; set; }Gets or sets the barcode type used to encode this GS1 Digital Link. Supported types are QR, DataMatrix, Aztec, Pdf417, MicroPdf417, DotCode, HanXin, CodablockF and Code128. The default value is QR.
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.
PrimaryApplicationIdentifier { get; }Gets the Application Identifier used as the Digital Link primary key. Null means that the primary key is selected automatically when the URI is constructed.
UriStem { get; }Gets the absolute URI prefix before the GS1 primary key path segment. The stem does not contain a query string or fragment.

Methods

NameDescription
static Create(string, GS1Codetext)Creates a GS1 Digital Link by copying all elements from GS1 codetext and selecting the only available primary key.
static Create(string, GS1Codetext, string)Creates a GS1 Digital Link by copying all elements from GS1 codetext and using the specified primary key.
static Parse(string)Parses an uncompressed GS1 Digital Link URI.
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 Digital Link.
GetConstructedCodetext()Constructs the uncompressed GS1 Digital Link URI.
GetFirst(string)Gets the first value for an Application Identifier.
InitFromString(string)Initializes this instance from an uncompressed GS1 Digital Link URI. Existing state is replaced only after the supplied URI has been parsed successfully. The selected barcode type is preserved.
ToGS1Codetext()Creates an independent GS1 codetext containing the current GS1 elements. URI-only information is not included.
override ToString()Returns the uncompressed GS1 Digital Link URI.
ToUriString()Formats the current object state as an uncompressed GS1 Digital Link URI.
static TryParse(string, out GS1DigitalLink, out GS1ValidationResult)Attempts to parse an uncompressed GS1 Digital Link URI and returns structured validation errors.
static Validate(string)Validates an uncompressed GS1 Digital Link URI without constructing an object.

See Also