VintaSoft Barcode .NET SDK v10.0
MailmarkCmdmValueItem Class
Members  Example 




Vintasoft.WpfBarcode.BarcodeInfo Namespace : MailmarkCmdmValueItem Class
Contains information about a decoded value of Mailmark CMDM 2D barcode.
Object Model
MailmarkCmdmValueItem Class
Syntax
'Declaration
 
Public Class MailmarkCmdmValueItem 
   Inherits ValueItemBase
'Usage
 
Dim instance As MailmarkCmdmValueItem
public class MailmarkCmdmValueItem : ValueItemBase 
public __gc class MailmarkCmdmValueItem : public ValueItemBase 
public ref class MailmarkCmdmValueItem : public ValueItemBase 
Example
Here is a simple example that demonstrates how to generate Mailmark CMDM 2D barcode:
Imports System.Windows.Media.Imaging   
   
Imports Vintasoft.WpfBarcode   
Imports Vintasoft.WpfBarcode.BarcodeInfo   
Imports Vintasoft.WpfBarcode.SymbologySubsets   
   
''' <summary>   
''' Test that demonstrates how to generate an image with Mailmark CMDM Type29 barcode and   
''' how to recognize Mailmark CMDM Type29 barcode in image.   
''' </summary>   
Class MailmarkCmdmValueItemExample   
   
	''' <summary>   
	''' Runs the test.   
	''' </summary>   
	Public Shared Sub Test()   
		' create the Mailmark CMDM 2D barcode value   
		Dim item As New MailmarkCmdmValueItem()   
		item.InformationTypeId = "0"   
		item.VersionId = "1"   
		item.[Class] = "0"   
		item.SupplyChainId = "1000009"   
		item.ItemId = "00009609"   
		item.Dps = "W1T1HQ9Z "   
		item.RtsFlag = "0"   
		item.ReturnToSenderPostCode = "SN35XX "   
		item.CustomerContent = "ABCDEFGHIJ1234567890A"   
   
		' create the barcode writer   
		Dim writer As New BarcodeWriter()   
   
		' encode Mailmark CMDM Type29 barcode   
		BarcodeSymbologySubsets.MailmarkCmdmType29.Encode(item, writer.Settings)   
   
		Dim infos As IBarcodeInfo()   
   
		' get image with barcode   
		Dim image As BitmapSource = writer.GetBarcodeAsBitmapSource()   
   
		' create the barcode reader   
		Using reader As New BarcodeReader()   
			' specify that reader must search for Mailmark CMDM Type29 barcodes only   
			reader.Settings.ScanBarcodeTypes = BarcodeType.None   
			reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.MailmarkCmdmType29)   
   
			' recognize barcode   
			infos = reader.ReadBarcodes(image)   
		End Using   
   
		' get barcode value   
		Dim readItem As MailmarkCmdmValueItem = DirectCast(infos(0).ValueItems(0), MailmarkCmdmValueItem)   
   
		' print barcode value   
		Console.WriteLine("Decoded value =              '{0}'", item.ToString())   
		Console.WriteLine("Information Type ID =        '{0}'", item.InformationTypeId)   
		Console.WriteLine("Version ID =                 '{0}'", item.VersionId)   
		Console.WriteLine("Class =                      '{0}'", item.[Class])   
		Console.WriteLine("Supply Chain ID =            '{0}'", item.SupplyChainId)   
		Console.WriteLine("Item ID =                    '{0}'", item.ItemId)   
		Console.WriteLine("DPS =                        '{0}'", item.Dps)   
		Console.WriteLine("RTS Flag =                   '{0}'", item.RtsFlag)   
		Console.WriteLine("Return To Sender Post Code = '{0}'", item.ReturnToSenderPostCode)   
		Console.WriteLine("Customer Content =           '{0}'", item.CustomerContent)   
   
		' check recognized barcode value   
		If item.ToString() <> readItem.ToString() Then   
			Throw New ApplicationException()   
		End If   
	End Sub   
End Class   
   
' This code example produces the following output:    
'   
'   Decoded value =              'JGB 010100000900009609W1T1HQ9Z 0SN35XX       ABCDEFGHIJ1234567890A'   
'   Information Type ID =        '0'   
'   Version ID =                 '1'   
'   Class =                      '0'   
'   Supply Chain ID =            '1000009'   
'   Item ID =                    '00009609'   
'   DPS =                        'W1T1HQ9Z '   
'   RTS Flag =                   '0'   
'   Return To Sender Post Code = 'SN35XX '   
'   Customer Content =           'ABCDEFGHIJ1234567890A'   
'
using System;
using System.Windows.Media.Imaging;
            
using Vintasoft.WpfBarcode;
using Vintasoft.WpfBarcode.BarcodeInfo;
using Vintasoft.WpfBarcode.SymbologySubsets;
            
/// <summary>
/// Test that demonstrates how to generate an image with Mailmark CMDM Type29 barcode and
/// how to recognize Mailmark CMDM Type29 barcode in image.
/// </summary>
class MailmarkCmdmValueItemExample
{
            
    /// <summary>
    /// Runs the test.
    /// </summary>
    public static void Test()
    {
        // create the Mailmark CMDM 2D barcode value
        MailmarkCmdmValueItem item = new MailmarkCmdmValueItem();
        item.InformationTypeId = "0";
        item.VersionId = "1";
        item.Class = "0";
        item.SupplyChainId = "1000009";
        item.ItemId = "00009609";
        item.Dps = "W1T1HQ9Z ";
        item.RtsFlag = "0";
        item.ReturnToSenderPostCode = "SN35XX ";
        item.CustomerContent = "ABCDEFGHIJ1234567890A";
            
        // create the barcode writer
        BarcodeWriter writer = new BarcodeWriter();
            
        // encode Mailmark CMDM Type29 barcode
        BarcodeSymbologySubsets.MailmarkCmdmType29.Encode(item, writer.Settings);
            
        IBarcodeInfo[] infos;
            
        // get image with barcode
        BitmapSource image = writer.GetBarcodeAsBitmapSource();
            
        // create the barcode reader
        using (BarcodeReader reader = new BarcodeReader())
        {
            // specify that reader must search for Mailmark CMDM Type29 barcodes only
            reader.Settings.ScanBarcodeTypes = BarcodeType.None;
            reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.MailmarkCmdmType29);
            
            // recognize barcode
            infos = reader.ReadBarcodes(image);
        }
            
        // get barcode value
        MailmarkCmdmValueItem readItem = (MailmarkCmdmValueItem)infos[0].ValueItems[0];
            
        // print barcode value
        Console.WriteLine("Decoded value =              '{0}'", item.ToString());
        Console.WriteLine("Information Type ID =        '{0}'", item.InformationTypeId);
        Console.WriteLine("Version ID =                 '{0}'", item.VersionId);
        Console.WriteLine("Class =                      '{0}'", item.Class);
        Console.WriteLine("Supply Chain ID =            '{0}'", item.SupplyChainId);
        Console.WriteLine("Item ID =                    '{0}'", item.ItemId);
        Console.WriteLine("DPS =                        '{0}'", item.Dps);
        Console.WriteLine("RTS Flag =                   '{0}'", item.RtsFlag);
        Console.WriteLine("Return To Sender Post Code = '{0}'", item.ReturnToSenderPostCode);
        Console.WriteLine("Customer Content =           '{0}'", item.CustomerContent);
            
        // check recognized barcode value
        if (item.ToString() != readItem.ToString())
            throw new ApplicationException();
    }
}
            
/* This code example produces the following output: 
            
   Decoded value =              'JGB 010100000900009609W1T1HQ9Z 0SN35XX       ABCDEFGHIJ1234567890A'
   Information Type ID =        '0'
   Version ID =                 '1'
   Class =                      '0'
   Supply Chain ID =            '1000009'
   Item ID =                    '00009609'
   DPS =                        'W1T1HQ9Z '
   RTS Flag =                   '0'
   Return To Sender Post Code = 'SN35XX '
   Customer Content =           'ABCDEFGHIJ1234567890A'
*/
Inheritance Hierarchy

System.Object
   Vintasoft.WpfBarcode.BarcodeInfo.ValueItemBase
      Vintasoft.WpfBarcode.BarcodeInfo.MailmarkCmdmValueItem

Requirements

Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

MailmarkCmdmValueItem Members
Vintasoft.WpfBarcode.BarcodeInfo Namespace