2022-02-17 15:45:42 +00:00
|
|
|
using System.Runtime.Serialization;
|
2022-02-17 17:29:41 +00:00
|
|
|
using ESCPOS_NET.Emitters;
|
2022-02-17 15:45:42 +00:00
|
|
|
|
|
|
|
public abstract class BaseInstruction
|
|
|
|
{
|
|
|
|
[DataMember(IsRequired = true)]
|
|
|
|
public string? type { get; set; }
|
|
|
|
|
|
|
|
public abstract List<byte[]> GetInstructions();
|
2022-02-17 17:29:41 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
2022-02-17 15:45:42 +00:00
|
|
|
}
|