public static int GetSettableUSBSerialNumberLength(PrinterModel model, string portName)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            int length = printerInfo.SettableUSBSerialNumberLength;

            if (model == PrinterModel.TSP100)
            {
                if (!IsUSBPrinterClassPort(portName) &&
                    !IsUSBVendorClassPort(portName)) // Not USB interface
                {
                    length = 0;
                }
                else if (IsTSP100IIIU(portName))
                {
                    length = 16; // TSP100IIIU supported 16digits USB-ID.
                }
                else
                {
                    length = 8; // TSP100U, TSP100GT, TSP100IIU
                }
            }

            if (model == PrinterModel.BSC10)
            {
                if (IsTCPPort(portName)) // BSC10 LAN model
                {
                    length = 0;
                }
            }

            return(length);
        }
        public static bool GetSetUSBSerialNumberIsEnabled(PrinterModel model, string portName)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            bool isEnabled = GetSettableUSBSerialNumberLength(model, portName) != 0;

            return(isEnabled);
        }
        public static bool GetCustomerDisplayIsEnabled(PrinterModel model, string portName)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            bool isEnabled = printerInfo.CustomerDisplayIsEnabled;

            if (model == PrinterModel.TSP100)
            {
                isEnabled = IsTSP100IIIU(portName); // Not support TSP100LAN, TSP100U, TSP100GT, TSP100IIU, TSP100IIIW, TSP100IIILAN, TSP100IIIBI.
            }

            return(isEnabled);
        }
        public static bool GetUSBSerialNumberIsEnabledDefault(PrinterModel model, string portName)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            bool isEnabledDefault = printerInfo.USBSerialNumberIsEnabledDefault;

            if (model == PrinterModel.TSP100)
            {
                isEnabledDefault = IsTSP100IIIU(portName); // TSP100LAN, TSP100U, TSP100GT, TSP100IIU, TSP100IIIW, TSP100IIILAN and TSP100IIIBI USB serial number is enabled default is off.
            }

            return(isEnabledDefault);
        }
        public static PrinterModel GetPrinterModelWithDeviceID(string deviceID)
        {
            foreach (KeyValuePair <PrinterModel, PrinterInfo> pair in ModelDictionary.ModelInformationDictionary)
            {
                PrinterModel model = pair.Key;
                PrinterInfo  info  = pair.Value;

                string[] refDeviceID = info.DeviceID;

                if (ContainsStringUpper(refDeviceID, deviceID))
                {
                    return(model);
                }
            }

            return(PrinterModel.Unknown);
        }
        public static PrinterModel GetPrinterModelWithBTDeviceNamePrefix(string btDeviceNamePrefix)
        {
            foreach (KeyValuePair <PrinterModel, PrinterInfo> pair in ModelDictionary.ModelInformationDictionary)
            {
                PrinterModel model = pair.Key;
                PrinterInfo  info  = pair.Value;

                string[] refBTDeviceNamePrefix = info.BTDeviceNamePrefix;

                if (StartsWithUpper(btDeviceNamePrefix, refBTDeviceNamePrefix))
                {
                    return(model);
                }
            }

            return(PrinterModel.Unknown);
        }
        public static PrinterModel GetPrinterModelWithModelName(string modelName)
        {
            foreach (KeyValuePair <PrinterModel, PrinterInfo> pair in ModelDictionary.ModelInformationDictionary)
            {
                PrinterModel model = pair.Key;
                PrinterInfo  info  = pair.Value;

                List <string> refModelNameList = new List <string>(info.ModelName);

                if (refModelNameList.Contains(modelName))
                {
                    return(model);
                }
            }

            return(PrinterModel.Unknown);
        }
        public static bool GetProductSerialNumberIsEnabled(PrinterModel model, string portName, string deviceID)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            bool isEnabled = printerInfo.ProductSerialNumberIsEnabled;

            if (model == PrinterModel.TSP100)
            {
                if (IsTCPPort(portName) && deviceID.Equals(GetSimpleModelName(PrinterModel.TSP100))) // Setting manually.
                {
                    isEnabled = true;
                }
                else
                {
                    isEnabled = IsTSP100III(portName, deviceID); // Not support TSP100LAN, TSP100U, TSP100GT, TSP100IIU.
                }
            }

            return(isEnabled);
        }
        public static PrinterModel GetPrinterModelWithDeviceIDAndNICName(string deviceID, string nicName)
        {
            foreach (KeyValuePair <PrinterModel, PrinterInfo> pair in ModelDictionary.ModelInformationDictionary)
            {
                PrinterModel model = pair.Key;
                PrinterInfo  info  = pair.Value;

                string[] refDeviceID = info.DeviceID;
                string   refNICName  = info.NICName;
                string   _nicName    = nicName;

                if (refNICName.Equals(""))
                {
                    _nicName = "";
                }

                if (ContainsStringUpper(refDeviceID, deviceID) && CompareStringUpper(refNICName, _nicName))
                {
                    return(model);
                }
            }

            return(PrinterModel.Unknown);
        }
Пример #10
0
        public static bool GetAllReceiptsIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.AllReceiptsIsEnabled);
        }
Пример #11
0
        public static int GetSoundVolumeMin(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.SoundVolumeMin);
        }
Пример #12
0
        public static int GetSoundNumberDefault(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.SoundNumberDefault);
        }
Пример #13
0
        public static bool GetChangeCashDrawerPolarityIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.ChangeCashDrawerPolarityIsEnabled);
        }
Пример #14
0
        public static string[] GetDeviceID(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.DeviceID);
        }
Пример #15
0
        public static Emulation GetEmulation(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.Emulation);
        }
Пример #16
0
        public static bool GetCashDrawerIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.CashDrawerIsEnabled);
        }
Пример #17
0
        public static bool GetPageModeIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.PageModeIsEnabled);
        }
Пример #18
0
        public static bool GetBlackMarkDetectionIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.BlackMarkDetectionIsEnabled);
        }
Пример #19
0
        public static bool GetRasterReceiptIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.RasterReceiptIsEnabled);
        }
Пример #20
0
        public static string GetSimpleModelName(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.SimpleModelName);
        }
Пример #21
0
        public static string[] GetModelName(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.ModelName);
        }
Пример #22
0
        public static string GetNICName(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.NICName);
        }
Пример #23
0
        public static string[] GetBTDeviceNamePrefix(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.BTDeviceNamePrefix);
        }
Пример #24
0
        public static PaperSize GetDefaultPaperSize(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(new PaperSize(printerInfo.DefaultPaperSize));
        }
Пример #25
0
        public static bool GetMelodySpeakerIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.MelodySpeakerIsEnabled);
        }
Пример #26
0
        public static bool GetBarcodeReaderIsEnabled(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.BarcodeReaderIsEnabled);
        }
Пример #27
0
        public static string GetDefaultPortSettings(PrinterModel model)
        {
            PrinterInfo printerInfo = GetPrinterInfo(model);

            return(printerInfo.DefaultPortSettings);
        }