public DataTable GetPrintersInfo()
        {
            _printers = new PrintersService(_scope, _options);
            var printerNamesList = _printers.GetPrinters();

            return(CreateExcelFile.ListToDataTable(printerNamesList, "Printers"));
        }
        public ProductController(IMapper mapper, IPrintersService printersService,
                                 IImpactPrintersService impactPrinterService, IEngraversService engraversService,
                                 IVinylCuttersService vinylCuttersService, IVerificationProvider verification)
        {
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(printersService, nameof(printersService)).IsNull().Throw();
            Guard.WhenArgument(impactPrinterService, nameof(impactPrinterService)).IsNull().Throw();
            Guard.WhenArgument(engraversService, nameof(engraversService)).IsNull().Throw();
            Guard.WhenArgument(vinylCuttersService, nameof(vinylCuttersService)).IsNull().Throw();

            this.mapper                = mapper;
            this.printersService       = printersService;
            this.impactPrintersService = impactPrinterService;
            this.engraversService      = engraversService;
            this.vinylCuttersService   = vinylCuttersService;
            this.verification          = verification;
        }
Example #3
0
 private void btnGetPrinters_Click(object sender, EventArgs e)
 {
     try
     {
         if (_sysConnector == null)
         {
             ShowConnectionErrorMessage();
         }
         else
         {
             _printers = new PrintersService(_sysConnector.Scope, _sysConnector.Options);
             listPrinters.DataSource    = new BindingList <PrinterInfo>(_printers.GetPrinters());
             listPrinters.DisplayMember = "Name";
         }
     }
     catch (Exception ex)
     {
         var message = new MessageWindow("Error", ex);
         message.ShowDialog();
     }
 }
Example #4
0
        public AdminController(IHttpContextProvider httpContext, IVerificationProvider verification,
                               IUsersService usersService, IMapper mapper, IPrintersService printersService,
                               IImpactPrintersService impactPrinterService, IEngraversService engraversService,
                               IVinylCuttersService vinylCuttersService)
        {
            Guard.WhenArgument(httpContext, nameof(httpContext)).IsNull().Throw();
            Guard.WhenArgument(verification, nameof(verification)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(printersService, nameof(printersService)).IsNull().Throw();
            Guard.WhenArgument(impactPrinterService, nameof(impactPrinterService)).IsNull().Throw();
            Guard.WhenArgument(engraversService, nameof(engraversService)).IsNull().Throw();
            Guard.WhenArgument(vinylCuttersService, nameof(vinylCuttersService)).IsNull().Throw();
            Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw();

            this.httpContext          = httpContext;
            this.verification         = verification;
            this.usersService         = usersService;
            this.mapper               = mapper;
            this.printersService      = printersService;
            this.impactPrinterService = impactPrinterService;
            this.engraversService     = engraversService;
            this.vinylCuttersService  = vinylCuttersService;
        }