Class MaxiCodeStructuredCodetext

MaxiCodeStructuredCodetext class

Base class for encoding and decoding the text embedded in the MaxiCode code for modes 2 and 3.

public abstract class MaxiCodeStructuredCodetext : MaxiCodeCodetext

Properties

NameDescription
CountryCode { get; set; }Identifies 3 digit country code.
ECIEncoding { get; set; }Gets or sets ECI encoding. Used when MaxiCodeEncodeMode is Auto. Default value: ISO-8859-1
MaxiCodeEncodeMode { get; set; }Gets or sets a MaxiCode encode mode. Default value: Auto.
PostalCode { get; set; }Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
SecondMessage { get; set; }Identifies second message of the barcode.
ServiceCategory { get; set; }Identifies 3 digit service category.

Methods

NameDescription
override Equals(object)Returns a value indicating whether this instance is equal to a specified MaxiCodeStructuredCodetext value.
GetBarcodeType()Gets barcode type.
override GetConstructedCodetext()Constructs codetext
override GetHashCode()Returns the hash code for this instance.
abstract GetMode()Gets MaxiCode mode.
override InitFromString(string)Initializes instance from constructed codetext.

Examples

This sample shows how to decode raw MaxiCode codetext to MaxiCodeStructuredCodetext instance.

[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.png", DecodeType.MaxiCode))
{
     foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        MaxiCodeCodetext resultMaxiCodeCodetext = ComplexCodetextReader.TryDecodeMaxiCode(result.Extended.MaxiCode.MaxiCodeMode, result.CodeText);
        if (resultMaxiCodeCodetext is MaxiCodeStructuredCodetext){
            MaxiCodeStructuredCodetext maxiCodeStructuredCodetext = (MaxiCodeStructuredCodetext)resultMaxiCodeCodetext;
            Console.WriteLine("BarCode Type: " + maxiCodeStructuredCodetext.PostalCode);
            Console.WriteLine("MaxiCode mode: " + maxiCodeStructuredCodetext.CountryCode);
            Console.WriteLine("BarCode CodeText: " + maxiCodeStructuredCodetext.ServiceCategory);
        }
    }
}

See Also