コード例 #1
0
        private void Form_SerialMonitor_Load(object sender, System.EventArgs e)
        {
            foreach (var item in Enum.GetValues(typeof(CommandType)))
            {
                var    name  = Enum.GetName(typeof(CommandType), item);
                UInt32 itemI = (UInt32)item;
                comboBox_command.Items.Add(string.Format("{0} - 0x{1}", name, itemI.ToString("X").Trim()));
            }

            foreach (var item in Enum.GetValues(typeof(CWA.DTP.Plotter.CommandType)))
            {
                var    name  = Enum.GetName(typeof(CWA.DTP.Plotter.CommandType), item);
                UInt32 itemI = (UInt32)item;
                comboBox_command.Items.Add(string.Format("{0} - 0x{1}", name, itemI.ToString("X").Trim()));
            }


            comboBox_command.SelectedIndex = 1;
            comboBox_sender.Items.AddRange(Enum.GetNames(typeof(SenderType)));
            comboBox_sender.SelectedIndex = 0;
            comboBox_conv.Items.AddRange(new string[] {
                "UInt16 To Bytes",
                "Int16 To Bytes",
                "UInt32 To Bytes",
                "Int32 To Bytes",
                "UInt64 To Bytes",
                "Int64 To Bytes",
                "Float To Bytes",
                "Double To Bytes",
                "String To Bytes",
            });
            comboBox_port.Items.Clear();
            comboBox_port.Items.AddRange(SerialPort.GetPortNames());
            comboBox_bd.Items.AddRange(BdRate.GetNamesStrings());
        }
コード例 #2
0
        private void Dialog_MacroPackEdit_Load(object sender, EventArgs e)
        {
            IconExtractor ie = new IconExtractor("Lib\\IconSet.dll");
            ImageList     il = new ImageList();

            il.Images.Add(ie.GetIcon((int)FileAssociation.IconIndex.Icon_Macros).ToBitmap());
            listBox_macroses.ImageList = il;
            comboBox_bdrate.Items.AddRange(BdRate.GetNamesStrings());
            comboBox_portname.Items.AddRange(ComPortName.GetNamesStrings());
            comboBox_macro_keybind.Items.AddRange(Enum.GetNames(typeof(Key)));
            for (int i = 30; i <= 256; i++)
            {
                comboBox_macro_charbind.Items.Add((char)i);
            }
            main = new MacroPack(
                TB.L.Phrase["Form_MacroPack.NoName"],
                TB.L.Phrase["Form_MacroPack.NoDiscr"],
                TB.L.Phrase["Form_MacroPack.NoName"]);
            UpDateGeneralSettings();
        }