Exemplo n.º 1
0
        private void setSerialPortComboboxPortItems(DevExpress.XtraEditors.ComboBoxEdit _control, string _default_key = null)
        {
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM1", "COM1");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM2", "COM2");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM3", "COM3");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM4", "COM4");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM5", "COM5");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM6", "COM6");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM7", "COM7");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM8", "COM8");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM9", "COM9");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM10", "COM10");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM11", "COM11");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM12", "COM12");
            KnDevexpressFunc.ComboBoxAddItem(_control, "COM30", "COM30");

            ManagementObjectSearcher serialPortSearcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort");

            foreach (ManagementObject Port in serialPortSearcher.Get())
            {
                KnDevexpressFunc.ComboBoxAddItem(_control, (string)Port.GetPropertyValue("DeviceId"), (string)Port.GetPropertyValue("Name"));
            }

            ManagementObjectSearcher win32PrinterSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_Printer");

            foreach (ManagementObject Port in win32PrinterSearcher.Get())
            {
                KnDevexpressFunc.ComboBoxAddItem(_control, (string)Port.GetPropertyValue("PortName"), (string)Port.GetPropertyValue("Name"));
            }

            if (null != _default_key)
            {
                KnDevexpressFunc.ComboBoxSetSelectByKey(_control, _default_key);
            }
        }
Exemplo n.º 2
0
        private void setSerialPortComboboxConnectType(DevExpress.XtraEditors.ComboBoxEdit _control, string _default_key = null)
        {
            KnDevexpressFunc.ComboBoxAddItem(_control, "0", "시리얼");

            if (null != _default_key)
            {
                KnDevexpressFunc.ComboBoxSetSelectByKey(_control, _default_key);
            }
        }
Exemplo n.º 3
0
        // ----------------------------------------------------------
        //
        private void setDlgComboboxOpenApiTypeItems(DevExpress.XtraEditors.ComboBoxEdit _control, string _default_key = null)
        {
            for (int i = 0; i < OpenApiBase.OPEN_API_TYPE_LIST.Length; i++)
            {
                OpenApiBase.OPEN_API_TYPE sel_type = OpenApiBase.OPEN_API_TYPE_LIST[i];

                KnDevexpressFunc.ComboBoxAddItem(_control, ((int)sel_type).ToString(), OpenApiBase.obtainDeliveryCompanyTypeName(sel_type));
            }

            if (null != _default_key)
            {
                KnDevexpressFunc.ComboBoxSetSelectByKey(_control, _default_key);
            }
        }
Exemplo n.º 4
0
        private void setSerialPortComboboxBaudItems(DevExpress.XtraEditors.ComboBoxEdit _control, string _default_key = null)
        {
            KnDevexpressFunc.ComboBoxAddItem(_control, "4800", "4,800");
            KnDevexpressFunc.ComboBoxAddItem(_control, "9600", "9,600");
            KnDevexpressFunc.ComboBoxAddItem(_control, "19200", "19,200");
            KnDevexpressFunc.ComboBoxAddItem(_control, "38400", "38,400");
            KnDevexpressFunc.ComboBoxAddItem(_control, "57600", "57,600");
            KnDevexpressFunc.ComboBoxAddItem(_control, "115200", "115,200");
            KnDevexpressFunc.ComboBoxAddItem(_control, "128000", "128,000");

            if (null != _default_key)
            {
                KnDevexpressFunc.ComboBoxSetSelectByKey(_control, _default_key);
            }
        }