Example #1
0
        public override void Apply(EpsonCommander commander)
        {
            if (Size != null)
            {
                commander.CharacterSize(Size).CarriageReturn();
            }
            if (Value == null)
            {
                Value = "";
            }
            string data;

            if (string.IsNullOrEmpty(Width))
            {
                data = Value;
            }
            else
            {
                int    width = Convert.ToInt32(Width);
                string text  = Normalize(Value, width);
                data = new string(' ', width);
                switch (Alignment)
                {
                case "C": data = data.Insert(GetCenteredOffset(width, text.Length), text); break;

                case "R": data = data.Insert(width - text.Length, text); break;

                case "L":
                default: data = data.Insert(0, text); break;
                }
                data = data.Substring(0, width);
            }
            commander.Text(data);
        }
Example #2
0
 public override void Revert(EpsonCommander commander)
 {
     if (Size != null)
     {
         commander.CharacterSize("1").CarriageReturn();
     }
 }
Example #3
0
 public void Execute(EpsonCommander commander)
 {
     Apply(commander);
     foreach (var child in Children)
     {
         child.Execute(commander);
     }
     Revert(commander);
 }
Example #4
0
 public override void Apply(EpsonCommander commander)
 {
     if (!string.IsNullOrEmpty(Lenght))
     {
         commander.Line(Convert.ToInt32(Lenght));
     }
     else
     {
         commander.Line();
     }
 }
Example #5
0
 public abstract void Revert(EpsonCommander commander);
Example #6
0
 public abstract void Apply(EpsonCommander commander);
Example #7
0
 public override void Revert(EpsonCommander commander)
 {
 }
Example #8
0
 public override void Apply(EpsonCommander commander)
 {
     commander.Cut(CutMode.Partial);
 }
Example #9
0
 public override void Revert(EpsonCommander commander)
 {
     commander.Align(Align.Left).CarriageReturn();
 }
Example #10
0
 public override void Apply(EpsonCommander commander)
 {
     commander.Align(Align.Center).CarriageReturn();
 }
Example #11
0
 public override void Revert(EpsonCommander commander)
 {
     commander.NewLine();
 }
Example #12
0
 public override void Apply(EpsonCommander commander)
 {
 }
Example #13
0
 public override void Apply(EpsonCommander commander)
 {
     commander.Feed(Convert.ToInt32(Lines));
 }
Example #14
0
 public override void Revert(EpsonCommander commander)
 {
     commander.Emphasis(false);
 }
Example #15
0
 public override void Apply(EpsonCommander commander)
 {
     commander.Emphasis(true);
 }