From ceee567981300733aa2107232da1049ff0b41a81 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Fri, 18 Feb 2022 19:32:13 +0100 Subject: [PATCH] EPSON in base class --- Instructions/BarcodeInstruction.cs | 1 - Instructions/BaseInstruction.cs | 2 ++ Instructions/TextInstruction.cs | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Instructions/BarcodeInstruction.cs b/Instructions/BarcodeInstruction.cs index 8e31482..cb3533b 100644 --- a/Instructions/BarcodeInstruction.cs +++ b/Instructions/BarcodeInstruction.cs @@ -27,7 +27,6 @@ public class BarcodeInstruction : BaseInstruction public override List GetInstructions() { - var e = new EPSON(); var commands = new List(); // if (width != BarWidth.Default) diff --git a/Instructions/BaseInstruction.cs b/Instructions/BaseInstruction.cs index 0fa2f00..dfbb373 100644 --- a/Instructions/BaseInstruction.cs +++ b/Instructions/BaseInstruction.cs @@ -8,6 +8,8 @@ public abstract class BaseInstruction public abstract List GetInstructions(); + protected EPSON e = new EPSON(); + protected byte[] alignmentCommand(Alignment alignment){ var e = new EPSON(); switch (alignment) diff --git a/Instructions/TextInstruction.cs b/Instructions/TextInstruction.cs index 820ef1e..2bb9fc7 100644 --- a/Instructions/TextInstruction.cs +++ b/Instructions/TextInstruction.cs @@ -21,7 +21,6 @@ public class TextInstruction : BaseInstruction public override List GetInstructions() { - var e = new EPSON(); var commands = new List(); commands.Add(alignmentCommand(alignment)); @@ -45,7 +44,6 @@ public class TextInstruction : BaseInstruction } private List setStyles(){ - var e = new EPSON(); var commands = new List(); if (underline){ commands.Add(e.SetStyles(PrintStyle.Underline));