printer-api/Instructions/BaseInstruction.cs
2022-02-17 18:29:41 +01:00

26 lines
531 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 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();
}
}
}