Ejemplo n.º 1
0
    private TicketPrinter()
    {
        ticket         = TicketType.None;
        isActive       = false;
        isAttended     = false;
        ticketsPrinted = new BigIntWrapper();

        printer       = PrinterType.Receipt;
        purchasePrice = new BigIntWrapper();

        batchTime = 0;
        batchSize = new BigIntWrapper();

        capacity             = new BigIntWrapper();
        capacityCurrentLevel = 0;
        capacityMaxLevel     = 1;
        capacityIncrement    = new BigIntWrapper();
        capacityUpgradeCost  = new BigIntWrapper();

        luck             = 0;
        luckCurrentLevel = 0;
        luckMaxLevel     = 1;
        luckIncrement    = 1;
        luckUpgradeCost  = new BigIntWrapper();
    }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a printer instance using the specified printer type.
        /// </summary>
        /// <param name="printerName">The name of the printer.</param>
        /// <param name="printerType">The type of the printer.</param>
        /// <returns>The printer instance.</returns>
        public static PrinterBase GetPrinter(string printerName, PrinterType printerType)
        {
            if (string.IsNullOrWhiteSpace(printerName))
            {
                throw new ArgumentException("The name of the printer cannot be null, empty nor contain only white-spaces.", nameof(printerName));
            }

            if (printer != null)
            {
                if (printer.PrinterName == printerName && printer.PrinterType == printerType)
                {
                    return(printer);
                }
            }

            if (printerType == PrinterType.Nii)
            {
                printer             = new NiiPrinter();
                printer.PrinterName = printerName;
                printer.PrinterType = printerType;
            }
            else if (printerType == PrinterType.TUP900)
            {
                printer             = new StarIOPrinter();
                printer.PrinterName = printerName;
                printer.PrinterType = printerType;
            }
            else
            {
                throw new InvalidOperationException("The printer type is not supported.");
            }

            return(printer);
        }
Ejemplo n.º 3
0
 public Job(string id, string printerid, string printerName, string title, string contentType, string fileUrl,
            string rasterUrl, string ticketUrl, long createTime, long updateTime, PrintJobState semanticState,
            PrintJobUiState uiState, LegacyJobStatus status, string errorCode, string message,
            List <string> tags, string ownerId, int numberOfPages, PrinterType printerType, string driveUrl)
 {
     Id            = id;
     PrinterId     = printerid;
     PrinterName   = printerName;
     Title         = title;
     ContentType   = contentType;
     FileUrl       = fileUrl;
     RasterUrl     = rasterUrl;
     TicketUrl     = ticketUrl;
     CreateTime    = createTime;
     UpdateTime    = updateTime;
     SemanticState = semanticState;
     UiState       = uiState;
     Status        = status;
     ErrorCode     = errorCode;
     Message       = message;
     Tags          = tags;
     OwnerId       = ownerId;
     NumberOfPages = numberOfPages;
     PrinterType   = printerType;
     DriveUrl      = driveUrl;
 }
Ejemplo n.º 4
0
        public PrinterFacade(PrinterConfiguration configuration, PrinterType type)
        {
            var creator = Creator.Instance;

            _fiscalPrinter = creator.GetPrinter(type, configuration);
            _observers     = new HashSet <IObserver <PrinterInfo> >();
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Printer" /> class.
        /// </summary>
        /// <param name="printerName">Printer name, shared name or port of printer install</param>
        /// <param name="type">Command set of type printer</param>
        /// <param name="colsNormal">Number of columns for normal mode print</param>
        /// <param name="colsCondensed">Number of columns for condensed mode print</param>
        /// <param name="colsExpanded">Number of columns for expanded mode print</param>
        public Printer(string printerName, PrinterType type, int colsNormal, int colsCondensed, int colsExpanded)
        {
            _printerName = string.IsNullOrEmpty(printerName) ? "temp.prn" : printerName.Trim();
            _printerType = type;

            #region Select printer type

            switch (type)
            {
            case PrinterType.Epson:
                _command = new EscPos();
                break;

            case PrinterType.Bematech:
                _command = new EscBema();
                break;

            case PrinterType.Daruma:
                _command = new EscDaruma();
                break;
            }

            #endregion

            #region Configure number columns

            ColsNomal     = colsNormal == 0 ? _command.ColsNomal : colsNormal;
            ColsCondensed = colsCondensed == 0 ? _command.ColsCondensed : colsCondensed;
            ColsExpanded  = colsExpanded == 0 ? _command.ColsExpanded : colsExpanded;

            #endregion
        }
Ejemplo n.º 6
0
 public PrinterModel(string fullName, PrinterType printerType, IReadOnlyCollection <PageMediaSize> pageSizeCapabilities, IReadOnlyCollection <PageOrientation> pageOrientationCapabilities)
 {
     FullName                    = fullName;
     PrinterType                 = printerType;
     PageSizeCapabilities        = pageSizeCapabilities;
     PageOrientationCapabilities = pageOrientationCapabilities;
 }
Ejemplo n.º 7
0
 internal PrinterFacade(
     IFiscalPrinter printer,
     PrinterConfiguration configuration,
     PrinterType type) : this(configuration, type)
 {
     _fiscalPrinter = printer;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// dp打印机获取打印命令
        /// </summary>
        /// <param name="mBitmap"></param>
        /// <param name="nWidth"></param>
        /// <param name="nMode"></param>
        /// <returns></returns>
        public static byte[] POS_PrintPicture(Bitmap mBitmap, int nWidth,
                                              int nMode, PrinterType printerType)
        {
            Bitmap rszBitmap;
            int    width;

            if (nWidth == mBitmap.Width)
            {
                rszBitmap = mBitmap;
                width     = nWidth;
            }
            else
            {
                width = (nWidth + 7) / 8 * 8;
                int height = mBitmap.Height * width / mBitmap.Width;
                rszBitmap = resizeImage(mBitmap, width, height);
            }
            byte[] src = bitmapToBWPix(rszBitmap);
            byte[] data;
            if (printerType == PrinterType.DP)
            {
                data = pixToCmd(src, width, nMode);
                rszBitmap.Dispose();
                rszBitmap = null;
                return(data);
            }
            else if (printerType == PrinterType.SPRT)
            {
                data = bitmap2PrinterBytes(src, width);
                rszBitmap.Dispose();
                rszBitmap = null;
                return(data);
            }
            return(null);
        }
Ejemplo n.º 9
0
 static GenPrinterBase()
 {
     ConfigUtil config = new ConfigUtil("DNPdfGenConfig", "Config/dnPdfConfig.ini");
     copy = int.Parse(config.Get("Copy"));
     printerBase = config.Get("PrinterBase");
     templateBasePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, config.Get("TemplatePath"));
     printerType = (PrinterType)int.Parse(config.Get("PrinterType"));
 }
        public void Print(string text, PrinterType printerType = PrinterType.PrintToScreen)
        {
            IPrinter printer = new PrinterBuilder()
                               .SetPrinterType(printerType)
                               .Build();

            printer.Print(text);
        }
Ejemplo n.º 11
0
 static PrinterConfig()
 {
     printerConfig = new ConfigUtil("Printer", "Config/printerConfig.ini");
     _copy = int.Parse(printerConfig.Get("Copy"));
     _templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, printerConfig.Get("Template"));
     //_templatePath = "";
     _printerName = printerConfig.Get("PrinterName");
     _printerType = (PrinterType)int.Parse(printerConfig.Get("PrinterType"));
 }
Ejemplo n.º 12
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Printer" /> class.
 /// </summary>
 /// <param name="printerName">Printer name, shared name or port of printer install</param>
 /// <param name="type">Command set of type printer</param>
 /// <param name="colsNormal">Number of columns for normal mode print</param>
 /// <param name="colsCondensed">Number of columns for condensed mode print</param>
 /// <param name="colsExpanded">Number of columns for expanded mode print</param>
 /// <param name="encoding">Custom encoding</param>
 /// <param name="protocol">Communication procotol</param>
 public Printer(string printerName, PrinterType type, int colsNormal, int colsCondensed, int colsExpanded, Encoding encoding, ProtocolType protocol)
 {
     _printerName = string.IsNullOrEmpty(printerName) ? "temp.prn" : printerName.Trim();
     _printerType = type;
     _encoding    = encoding;
     _command     = PrinterCommandFactory(type);
     _engine      = EngineFactory(protocol);
     ConfigureCols(colsNormal, colsCondensed, colsExpanded);
 }
        private void EditPrinterType(int PrinterTypeId)
        {
            this.PrinterType = this.srvPrinterType.GetById(PrinterTypeId);

            this.ClearDetailControls();
            this.LoadFormFromEntity();
            this.frmPrinterType.HiddenDetail(false);
            this.ShowDetail(true);
        }
Ejemplo n.º 14
0
 static SettingConfig()
 {
     printerConfig = new ConfigUtil("Printer", "Config/settingConfig.ini");
     _copy = int.Parse(printerConfig.Get("Copy"));
     _templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, printerConfig.Get("Template"));
     _printerName = printerConfig.Get("PrinterName");
     _printerType = (PrinterType)int.Parse(printerConfig.Get("PrinterType"));
     proxyConfig = new ConfigUtil("ProxyConfig", "Config/settingConfig.ini");
     _netProxyType = NetProxy.GetNetProxyType(int.Parse(proxyConfig.Get("NetProxy")));
 }
Ejemplo n.º 15
0
        public static Type GetConfigType(PrinterType printerType)
        {
            var configType = Type.GetType($"Overseer.Core.Models.{printerType}Config");

            if (configType == null)
            {
                throw new ArgumentOutOfRangeException(nameof(printerType), "Unknown Printer Type");
            }

            return(configType);
        }
        public PrinterInformation(string name, PrinterType printerType, PrinterFormatType printerFormatType,
                                  string prefixSearchPaperSize)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name                  = name;
            PrinterType           = printerType;
            PrinterFormatType     = printerFormatType;
            PrefixSearchPaperSize = prefixSearchPaperSize;
        }
 private void DeleteEntity(int PrinterTypeId)
 {
     if (MessageBox.Show("¿Esta seguro de eliminar el Tipo de Impresora?", "Advertencia",
                         MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this.PrinterType           = this.srvPrinterType.GetById(PrinterTypeId);
     this.PrinterType.Activated = false;
     this.PrinterType.Deleted   = true;
     this.srvPrinterType.SaveOrUpdate(this.PrinterType);
     this.Search();
 }
Ejemplo n.º 18
0
        public override PrinterType GetSearchResult()
        {
            PrinterType  PrinterType = null;
            UltraGridRow activeRow   = this.grdSchSearch.ActiveRow;

            if (activeRow != null)
            {
                int PrinterTypeId = Convert.ToInt32(activeRow.Cells[0].Value);
                PrinterType = this.srvPrinterType.GetById(PrinterTypeId);
            }

            return(PrinterType);
        }
 private void printerType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ((printerType.SelectedItem as PrinterType).ID == -1)
     {
         StringReference newTypeName = new StringReference();
         if (new NewValueForm(newTypeName, "Тип устройства").ShowDialog() == DialogResult.OK)
         {
             PrinterType pType = new PrinterType(newTypeName.Value);
             pType.Create();
             CommonElements.PrintersTypes.Insert(0, pType);
             printerType.SelectedIndex = 0;
         }
     }
 }
Ejemplo n.º 20
0
 public QueryExecutionHelper(int threadCount, PrinterType printer, FormaterType formater, int verticesPerThread, int arraySize, string fileName, string ppmName, string stpmName, string patternName, GrouperAlias grouperName, SorterAlias sorterName)
 {
     this.ThreadCount                    = threadCount;
     this.Printer                        = printer;
     this.Formater                       = formater;
     this.VerticesPerThread              = verticesPerThread;
     this.FixedArraySize                 = arraySize;
     this.FileName                       = fileName;
     this.ParallelPatternMatcherName     = ppmName;
     this.SingleThreadPatternMatcherName = stpmName;
     this.PatternName                    = patternName;
     this.GrouperAlias                   = grouperName;
     this.SorterAlias                    = sorterName;
 }
Ejemplo n.º 21
0
        public static IPrintable create(PrinterType printerType)
        {
            IPrintable printer = null;

            switch (printerType)
            {
            case PrinterType.CONSOLE:
            {
                printer = new ConsolePrint();
                break;
            }
            }

            return(printer);
        }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            PrinterType printerType = PrinterType.Console;

            if (args.Length > 0)
            {
                printerType = (PrinterType)Enum.Parse(typeof(PrinterType), args[0], true);
            }
            IMessagePrinter      printer   = MessagePrinterFactory.GetMessagePrinterInstance(printerType);
            IHelloWorldGenerator generator = HelloWorldGeneratorFactory.GetHelloWorldGeneratorInstance(GeneratorType.Console, printer);

            if (generator != null)
            {
                generator.SayHello();
            }
        }
Ejemplo n.º 23
0
        public Printer(string printerName, PrinterType type)
        {
            _printerName = string.IsNullOrEmpty(printerName) ? "temp.prn" : printerName.Trim();
            _printerType = type;

            switch (type)
            {
            case PrinterType.Epson:
                _command = new EscPos();
                break;

            case PrinterType.Bematech:
                _command = new EscBema();
                break;
            }
        }
Ejemplo n.º 24
0
        private void populatePrinterAccessoryDropDown(PrinterType printerType)
        {
            var list        = new List <SelectListItem>();
            var accessories = _context.PrinterAccessories
                              .Where(a => a.PrinterAccessoryType.Any(b => b.PrinterTypeId == printerType.PrinterTypeId));

            foreach (var item in accessories)
            {
                list.Add(new SelectListItem()
                {
                    Text  = string.Format("{0} {1} (ID:{2})", item.Name, item.PartNumber, item.PrinterAccessoryId),
                    Value = item.PrinterAccessoryId.ToString()
                });
            }
            ViewData["PrinterAccessories"] = list;
        }
Ejemplo n.º 25
0
        private IPrintCommand PrinterCommandFactory(PrinterType type)
        {
            switch (type)
            {
            case PrinterType.Epson:
                return(new EscPos());

            case PrinterType.Bematech:
                return(new EscBema());

            case PrinterType.Daruma:
                return(new EscDaruma());

            default:
                return(new EscPos());
            }
        }
Ejemplo n.º 26
0
        public IPrinter CreatePrinter(PrinterType printerType)
        {
            switch (printerType)
            {
            case PrinterType.DotMatrix:
                return(new DotMatrixPrinter("Dot Matrix Printer"));

            case PrinterType.Jet:
                return(new JetPrinter("Jet Printer"));

            case PrinterType.Laser:
                return(new LaserPrinter("Dot Matrix Printer"));

            default:
                return(null);
            }
        }
Ejemplo n.º 27
0
        public static IPrinter CreatePrinter(PrinterType printerType)
        {
            IPrinter printer = null;

            switch (printerType)
            {
            case PrinterType.BradyPrinter:
                printer = new Printers.BradyPrinter();
                break;

            case PrinterType.ZebraPrinter:
                printer = new ZebraPrinter();
                break;
            }

            return(printer);
        }
Ejemplo n.º 28
0
        public IFiscalPrinter GetPrinter(PrinterType type, PrinterConfiguration configuration)
        {
            switch (type)
            {
            case PrinterType.Posnet:
                return(GetPrinter <PosnetPrinter>(configuration));

            case PrinterType.Elzab:
                return(GetPrinter <ElzabPrinter>(configuration));

            case PrinterType.Novitus:
                return(GetPrinter <NovitusPrinter>(configuration));

            default:
                return(GetPrinter <PosnetPrinter>(configuration));
            }
        }
Ejemplo n.º 29
0
 public Printer(string id, string name, string defaultDisplayName, string displayName, string description,
                PrinterType type, string proxy, long createTime, long accessTime, long updateTime, bool isTosAccepted,
                List <string> tags, dynamic capabilities, string capsHash, CapabilitiesFormat capsFormat, string ownerId,
                string ownerName, List <PrinterAcl> access, bool @public, bool quotaEnabled, int dailyQuota, int currentQuota,
                LocalSettings local_settings, string uuid, string manufacturer, string model, string gcpVersion, string setupUrl,
                string supportUrl, string updateUrl, string firmware, string supportedContentTypes, ConnectionStatusType connectionStatus,
                dynamic semanticState, dynamic uiState, int queuedJobsCount)
 {
     Id   = id;
     Name = name;
     DefaultDisplayName = defaultDisplayName;
     DisplayName        = displayName;
     Description        = description;
     Type                  = type;
     Proxy                 = proxy;
     CreateTime            = createTime;
     AccessTime            = accessTime;
     UpdateTime            = updateTime;
     IsTosAccepted         = isTosAccepted;
     Tags                  = tags;
     Capabilities          = capabilities;
     CapsHash              = capsHash;
     CapsFormat            = capsFormat;
     OwnerId               = ownerId;
     OwnerName             = ownerName;
     Access                = access;
     Public                = @public;
     QuotaEnabled          = quotaEnabled;
     DailyQuota            = dailyQuota;
     CurrentQuota          = currentQuota;
     LocalSettings         = local_settings;
     Uuid                  = uuid;
     Manufacturer          = manufacturer;
     Model                 = model;
     GcpVersion            = gcpVersion;
     SetupUrl              = setupUrl;
     SupportUrl            = supportUrl;
     UpdateUrl             = updateUrl;
     Firmware              = firmware;
     SupportedContentTypes = supportedContentTypes;
     ConnectionStatus      = connectionStatus;
     SemanticState         = semanticState;
     UiState               = uiState;
     QueuedJobsCount       = queuedJobsCount;
 }
        public static IMessagePrinter GetMessagePrinterInstance(PrinterType type)
        {
            IMessagePrinter printer = null;

            switch (type)
            {
            case PrinterType.Console:
            {
                printer = new ConsoleMessagePrinter();
                break;
            }

            default:
            {
                throw new NotImplementedException();
            }
            }
            return(printer);
        }
Ejemplo n.º 31
0
        public frmStudentPrinter(PrinterType _printType, string _id)
        {
            InitializeComponent();
            this.printerType = _printType;
            switch (_printType)
            {
            case PrinterType.StudentResultList:
                classID = _id;
                break;

            case PrinterType.StudentResult:
                studentID = _id;
                break;

            case PrinterType.StudentList:
                classID = _id;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 32
0
 /// <summary>
 /// 将BitImage对象写入打印队列
 /// </summary>
 /// <param name="bitmap"></param>
 /// <param name="err"></param>
 /// <returns></returns>
 public bool PrintImg(Bitmap bitmap, PrinterType pt, out string err)
 {
     err = "";
     if (!isPrintOk)
     {
         err = "打印机初始化失败,无法正常使用";
         return(false);
     }
     if (bitmap == null)
     {
         err = "bitmap不能为null";
         return(false);
     }
     try
     {
         byte[] data    = Pos.POS_PrintPicture(bitmap, 384, 0, pt);
         byte[] cmdData = new byte[data.Length + 6];
         cmdData[0] = 0x1B;
         cmdData[1] = 0x2A;
         cmdData[2] = 0x33;
         cmdData[3] = 0x20;
         cmdData[4] = 0x2;
         cmdData[5] = 0x50;
         for (int i = 0; i < data.Length; i++)
         {
             cmdData[6 + i] = data[i];
         }
         //PrintQueue.QueueList.Enqueue(cmdData);
         //CheckPrintState(out err);
         SendData(cmdData, out err);
         return(true);
     }
     catch (Exception ex)
     {
         err = ex.Message;
         return(false);
     }
 }
Ejemplo n.º 33
0
        public static string GetPrinterName(PrinterType printerType)
        {
            CoreApp.clsConnection_DAL ObjCon = new clsConnection_DAL(true);
            string printerName = "";

            if (printerType == PrinterType.BarCodePrinter)
            {
                DataTable dtPrinter = ObjCon.ExecuteSelectStatement("SELECT * FROM [tblPrinterSetting] WITH(NOLOCK) WHERE machineName='" + Environment.MachineName + "' ");
                if (dtPrinter.Rows.Count > 0)
                {
                    printerName = dtPrinter.Rows[0]["BarCodePrinter"].ToString();
                }
            }
            else if (printerType == PrinterType.InvoicePrinter)
            {
                DataTable dtPrinter = ObjCon.ExecuteSelectStatement("SELECT * FROM [tblPrinterSetting] WITH(NOLOCK) WHERE machineName='" + Environment.MachineName + "' ");
                if (dtPrinter.Rows.Count > 0)
                {
                    printerName = dtPrinter.Rows[0]["InvoicePrinter"].ToString();
                }
            }
            return(printerName);
        }
Ejemplo n.º 34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="queue">Print queue</param>
 /// <param name="isDefault">A value indication whether printer is default</param>
 /// <param name="type">Printer type</param>
 public PrinterInfo(PrintQueue queue, bool isDefault, PrinterType type)
 {
     Queue = queue;
     IsDefault = isDefault;
     Type = type;
 }
Ejemplo n.º 35
0
        // many printers
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="printerData"></param>
        public static void Print(PrinterType type, DataTable order)
        {
            // sort printers by name
            List<string> prnNames = new List<string>();
            foreach (KeyValuePair<string, Dictionary<string, string>> printer in AppConfig.Path_Printers)
                prnNames.Add(printer.Key.ToString());
            string[] sortedNames = prnNames.ToArray();
            Array.Sort<string>(sortedNames);
            Dictionary<string, Dictionary<string, string>> sortedPrintersByName = new Dictionary<string, Dictionary<string, string>>();
            for (int i = 0; i < sortedNames.Length; i++)
                sortedPrintersByName.Add(sortedNames[i], AppConfig.Path_Printers[sortedNames[i]]);

            foreach (KeyValuePair<string, Dictionary<string, string>> printer in sortedPrintersByName)
            {
                if (printer.Value["TYPE"].ToString() == ((int)type).ToString())
                {
                    try
                    {
                        PrintThrowPrinter(printer, order);
                    }
                    catch (Exception e) { CoreLib.WriteLog(e, "mdcore.Lib.DataWorkOutput.Print(PrinterType type, DataTable order);"); }
                }
            }
        }
Ejemplo n.º 36
0
 public BluetoothPrinter(Android.App.Activity activity, PrinterType type, string Number)
 {
     this.as_Number = Number;
     this.printerType = type;
     this.activity = activity;
     //获得本地的蓝牙适配器
     localAdapter = Android.Bluetooth.BluetoothAdapter.DefaultAdapter;
     if (string.IsNullOrEmpty(Number))
     {
         Android.Widget.Toast.MakeText(activity, "传入的单号为空,打印失败", Android.Widget.ToastLength.Short).Show();
         return;
     }
     //打开蓝牙设备
     if (!localAdapter.IsEnabled)
     {
         Android.Content.Intent enableIntent = new Android.Content.Intent(Android.Bluetooth.BluetoothAdapter.ActionRequestEnable);
         activity.StartActivityForResult(enableIntent, 1);
     }
     //静默打开
     if (!localAdapter.IsEnabled)
     {
         localAdapter.Enable();
     }
     if (!localAdapter.IsEnabled)//用户拒绝打开或系统限制权限
     {
         Android.Widget.Toast.MakeText(activity, "蓝牙未打开", Android.Widget.ToastLength.Short).Show();
         return;
     }
     //获得已配对的设备列表
     bondedDevices = new List<Android.Bluetooth.BluetoothDevice>(localAdapter.BondedDevices);
     if (bondedDevices.Count <= 0)
     {
         Android.Widget.Toast.MakeText(activity, "未找到已配对的蓝牙设备", Android.Widget.ToastLength.Short).Show();
         return;
     }
     string[] items = new string[bondedDevices.Count];
     for (int i = 0; i < bondedDevices.Count; i++)
     {
         items[i] = bondedDevices[i].Name;
     }
     Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(activity);
     builder.SetTitle("请选择打印设备:");
     builder.SetItems(items, new System.EventHandler<Android.Content.DialogClickEventArgs>(items_click));
     builder.SetNegativeButton("取消", delegate { return; });
     builder.Show();
 }