1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Bowin.Common.BarCode
- {
- /// <summary>
- /// 条码类工厂
- /// </summary>
- 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;
- }
- }
- }
|