public ThermalPrinter()
        {
            isBusy    = false;
            cancelled = false;

            this.dll     = Config.App.Peripheral["thermalPrinter"].Value <string>("dll");
            this.timeout = Config.App.Peripheral["thermalPrinter"].Value <int>("timeout");
            this.enabled = Config.App.Peripheral["thermalPrinter"].Value <bool>("enabled");
            this.name    = Config.App.Peripheral["thermalPrinter"].Value <string>("name");

            printAsyncCaller = new RunAsyncCaller(Print);
            queue            = new ConcurrentQueue <JObject>();

            printDocument = new PrintDocument();
            printDocument.PrintController             = new StandardPrintController();
            printDocument.PrinterSettings.PrinterName = name;
            printDocument.PrinterSettings.DefaultPageSettings.Margins.Left = 0;
            printDocument.PrinterSettings.DefaultPageSettings.Margins.Top  = 0;
            //设置边距
            //Margins margin = new Margins(20, 20, 20, 20);
            //pd.DefaultPageSettings.Margins = margin;
            //纸张设置默认
            //PaperSize pageSize = new PaperSize("PaperSize", 200, 800);
            //printDocument.DefaultPageSettings.PaperSize = pageSize;
            printDocument.PrintPage += new PrintPageEventHandler(this.PrintPage);

            Initialize();
        }
示例#2
0
 public Finger()
 {
     isBusy        = false;
     cancelled     = false;
     this.dll      = Config.App.Peripheral["finger"].Value <string>("dll");
     this.timeout  = Config.App.Peripheral["finger"].Value <int>("timeout");
     this.enabled  = Config.App.Peripheral["finger"].Value <bool>("enabled");
     this.name     = Config.App.Peripheral["finger"].Value <string>("name");
     scriptInvoker = AutofacContainer.ResolveNamed <IScriptInvoker>("scriptInvoker");
     asyncCaller   = new RunAsyncCaller(Read);
     Initialize();
 }
示例#3
0
        public IDCardReader()
        {
            this.cancelled = false;
            this.dll       = Config.App.Peripheral["idCardReader"].Value <string>("dll");
            this.timeout   = Config.App.Peripheral["idCardReader"].Value <int>("timeout");
            this.enabled   = Config.App.Peripheral["idCardReader"].Value <bool>("enabled");
            this.logLevel  = Config.App.Peripheral["idCardReader"].Value <int>("logLevel");
            this.index     = Config.App.Peripheral["idCardReader"].Value <int>("index");

            //scriptInvoker = AutofacContainer.ResolveNamed<IScriptInvoker>("scriptInvoker");
            readAsyncCaller = new RunAsyncCaller(Read);

            Initialize();
        }