using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Bowin.Common.BarCode { /// /// 条码类工厂 /// public class BarCodeFactory { public static BarCodeBase CreateBarCard(BarCodeType type, string rawData) { BarCodeBase barCode = null; switch (type) { case BarCodeType.Code128: barCode = new Code128(rawData); break; case BarCodeType.Code128A: barCode = new Code128(rawData, Code128Type.A); break; case BarCodeType.Code128B: barCode = new Code128(rawData, Code128Type.B); break; case BarCodeType.Code128C: barCode = new Code128(rawData, Code128Type.C); break; //case BarCodeType.Code39: // barCode = new Code39(rawData); // break; //case BarCodeType.Code39Extended: // barCode = new Code39(rawData, true); // break; //case BarCodeType.Code93: // barCode = new Code93(rawData); // break; //case BarCodeType.EAN13: // barCode = new EAN13(rawData); // break; //case BarCodeType.EAN8: // barCode = new EAN8(rawData); // break; //case BarCodeType.ISBN: // barCode = new ISBN(rawData); // break; //case BarCodeType.CodeBar: // barCode = new CodaBar(rawData); // break; default: throw new Exception("未知"); } return barCode; } } }