28 lines
566 B
C#
28 lines
566 B
C#
using System.Runtime.Serialization;
|
|
using ESCPOS_NET.Emitters;
|
|
|
|
public abstract class BaseInstruction
|
|
{
|
|
[DataMember(IsRequired = true)]
|
|
public string? type { get; set; }
|
|
|
|
public abstract List<byte[]> GetInstructions();
|
|
|
|
protected EPSON e = new EPSON();
|
|
|
|
protected byte[] alignmentCommand(Alignment alignment){
|
|
var e = new EPSON();
|
|
switch (alignment)
|
|
{
|
|
case Alignment.Center:
|
|
return e.CenterAlign();
|
|
case Alignment.Left:
|
|
return e.LeftAlign();
|
|
case Alignment.Right:
|
|
return e.RightAlign();
|
|
default:
|
|
return e.LeftAlign();
|
|
}
|
|
}
|
|
}
|