Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Columns property in order to get extra commands based off it #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

igorocampos
Copy link
Collaborator

@igorocampos igorocampos commented Jan 26, 2024

Addresses suggestions of #210 and #147

A new property that holds the column count so it's easier to write horizontal line and align texts to both left and right on the same line.


namespace ESCPOS_NET.Emitters
{
public abstract partial class BaseCommandEmitter : ICommandEmitter
{
public int Columns { get; set; } = 42;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about the default for this, 42 columns is what the majority of printers I dealt with in Brazil had, but as an alternative, we could just not set any default value for the property, make it a getter-only property and force the constructor to receive the column count. However that would be a breaking change, so between having a random number as default and breaking existing code from others, I decided to stick with a default value.

What do you think @lukevp ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant